Grant permissions to users

To grant a user permission on a database object, use either the GRANT statement or Sybase Central.

In Sybase Central, you can view and change permissions either per user or per database object. For example, if you want to see who has permission on a specific table, you can view the table's permissions by clicking the table in the left pane and clicking its Permissions tab in the right pane. Similarly, if you want to change all the permissions for a specific user, you can view all of the user's explicitly-set table permissions by clicking the user in the left pane and clicking its Table Permissions tab in the right pane.

 Grant permissions to a user on tables, views, columns, procedures, dbspaces, or sequence generators (Sybase Central)
  1. Use the SQL Anywhere 12 plug-in to connect to the database as either a user with DBA authority or as the user who owns the database object that you want to grant permission on.

  2. In the left pane, either click the database object that you want to grant a user permission on, or click the user (or group) to whom you want to grant permissions to.

    • To grant permissions per user   If you clicked a user (or group), then in the right pane click the permissions tab that corresponds to the database object that you want to grant permissions on. For example, to grant permissions on a table, click the Table Permissions tab.

      The permissions tabs list the names of the database objects that the user (or group) has explicitly set permissions on. To grant permissions to the user on a database object, right-click and click New » Permissions.

    • To grant permissions per database object   If you clicked a database object, then in the right pane click the Permissions tab.

      The Permissions tab lists in the Grantee column the users and groups that currently have permissions on the database object. To grant permissions to users and groups, right-click and click New » Permissions.

  3. Select the row of the database object or user whose permissions you want to modify.

    • To grant permissions on dbspaces, procedures, functions, sequence generators, and views   Click the permission column beside the database object to add a checkmark. A checkmark grants the permission to the user or group.

    • To grant permissions on tables and table columns   When you select a table, the corresponding Column Permissions table appears below the Permissions table.

      • To grant permission on a table   In the Table Permissions table, click the permission column beside the user or group, and add a checkmark or a checkmark with a plus sign (+).

        A checkmark grants the permission to the user (or group). A checkmark with a plus sign (+) grants the permission to the user and grants the user the permission to grant the same permission to other users. A checkmark with a plus sign (+) is equivalent to executing the GRANT statement with the WITH GRANT OPTION clause.

      • To grant permission on a table column   In the Column Permissions table, click the column beside the table column, and add a checkmark or a checkmark with a plus sign (+).

        When you modify a column in the Column Permissions table, Column permissions are granted/granted with grant option icon appears in the Table Permissions above.

      When you grant permissions to groups, the permissions are inherited by the members of the group. But, the permission to grant the same permission to other users is not inherited by the members of the group.

  4. Click File » Save to save all your changes.

Tip
  • To undo your changes, select one or more rows in the permissions tab and click Edit » Undo.

  • To turn on or off the Legend for the permissions table, click File » Show Legend.

 Grant permissions on tables, views, columns, procedures, dbspaces, and sequence generators (SQL)
  1. Connect to the database as a user with DBA authority.

  2. Execute a GRANT statement to assign the permission.

 See also
 Examples