Advantage Client Engine
Makes a database user not a member of the specified user group.
UNSIGNED32 AdsDDRemoveUserFromGroup( ADSHANDLE hAdminConn,
UNSIGNED8 *pucGroupName,
UNSIGNED8 *pucUserName );
hAdminConn (I) |
Handle of a database connection. |
pucGroupName (I) |
Name of the database user group object to remove the user’s membership. |
pucUserName (I) |
Name of the database user object to remove from the user group’s membership. |
AE_INVALID_OBJECT_NAME |
Either the pucGroupName does not specify a valid user group in the database or the pucUserName does not specify a valid database user. |
AE_NOT_MEMBER_OF_GROUP |
The user is not a member of the specified user group. |
AdsDDRemoveUserFromGroup removes the user from the membership of the specified user group. Once the user is removed from the membership of the user group, the user loses all object access rights that he inherited from the user group.
ALTER permissions on the user group are required to remove a user from a data dictionary user group. See Advantage Data Dictionary User Permissions for more information.
Note This function can be called inside a transaction, but will not be part of the transaction. Any changes it makes cannot be rolled back.
After making a connection to the database, remove user "rsmith" from the user group "Managers". If the only rights the user has to the table "employees" are inherited from the "Managers" user group, the user "rsmith" will now have no rights to the "employees" table after being removed from the user group.
AdsConnect60( "n:\\MyData\\myData.ADD", ADS_REMOTE_SERVER, "ADSSYS", NULL, ADS_DEFAULT, &hDD );
ulReturnCode = AdsDDRemoveUserFromGroup( hDD, "Managers", "rsmith" );
AdsDisconnect( hDD );
AdsConnect60( "n:\\MyData\\myData.ADD", ADS_REMOTE_SERVER, "rsmith", NULL, ADS_DEFAULT, &hConn );
/* The following call should fail with an error of either a 7079 or 7080 */
ulReturnCode = AdsOpenTable( hConn, "employees", NULL, ADS_DEFAULT, ADS_DEFAULT, ADS_DEFAULT,
ADS_DEFAULT, ADS_DEFAULT, &hTable );