The SetPermssions method of both the Group and User objects allows you to specify the permissions a group or user has to a database object.
The ObjectType option specifies the type of object to which the permission will be applied.
Constant | Value | Description |
---|---|---|
AdPermObjColumn | 2 | The object is a column. |
AdPermObjDatabase | 3 | The object is a database. |
adPermObjProcedure | 4 | The object is a procedure. |
adPermObjProviderSpecific | −1 | The object type is defined by the provider. If you specify this value, you must also supply an ObjectTypeID |
AdPermObjTable | 1 | The object is a table. |
AdPermObjView | 5 | The object is a view. |
The Action option specifies what you intend to do with the permission to the specified object.
Constant | Value | Description |
---|---|---|
adAccessDeny | 3 | Deny the specified permissions. |
adAccessGrant | 1 | Grant the specified permissions. The permissions specified are added to those that have already been granted. |
adAccessRevoke | 4 | Revoke all permissions. |
adAccessSet | 2 | Set the specified permissions. Only the specified permissions will be in force. |
The Rights option specifies the actual rights, or permissions, that you are denying, granting, revoking, or setting.
Constant | Value | Description |
---|---|---|
AdRightCreate | 16384 | The user/group has permission to create a new object of the specified type. |
AdRightDelete | 65536 | The user/group has permission to delete data from the specified object. For objects such as tables, the user also has permission to delete data. |
AdRightDrop | 256 | The user/group has permission to remove objects from the catalog. |
AdRightExclusive | 512 | The user/group has permission to access the object exclusively. |
AdRightExecute | 536870912 | The user/group has permission to execute the object. |
AdRightFull | 268435456 | The user/group has all permissions on the object. |
AdRightInsert | 32768 | The user/group has permission to insert the object. For objects such as tables, the user also has permission to insert data. |
adRightMaximumAllowed | 33554432 | The user/group has the maximum number of permissions allowed by the provider. |
AdRightNone | 0 | The user/group has no permissions for the object. |
AdRightRead | −2147483648 | The user/group has permission to read the object. For objects such as tables, the user also has permission to read its data. |
AdRightReadDesign | 1024 | The user/group has permission to read the object's design. |
adRightReadPermissions | 131072 | The user/group can view, but not change, the specific permissions for an object in the catalog. |
AdRightReference | 8192 | The user/group has permission to reference the object. |
AdRightUpdate | 1073741824 | The user/group has permission to update the object. For objects such as tables, the user also has permission to update its data. |
AdRightWithGrant | 4096 | The user/group has permission to grant permissions on the object to other users. |
AdRightWriteDesign | 2048 | The user/group has permission to modify the object's design. |
AdRightWriteOwner | 524288 | The user/group has permission to modify the object's owner. |
adRightWritePermissions | 262144 | The user/group has permissions to modify the specific permissions for an object in the catalog. |
The Inherit option specifies how the specified object inherits permissions.
Constant | Value | Description |
---|---|---|
AdInheritBoth | 3 | The objects and containers contained by the primary object inherit the permissions. |
AdInheritContainers | 2 | Other objects contained by the primary object also inherit the permissions. |
AdInheritNone | 0 | Default. Do not inherit permissions. |
AdInheritNoPropagate | 4 | The adInheritObjects and adInheritContainers flags are not inherited. |
AdInheritObjects | 1 | Objects outside the container inherit the permissions. |
3.145.37.126