Gets the access rights of a user.
int
ade_usergetrights(
char* userName,
int* pUserRights);
Returns RTNORM or an error code.
username | Login name, at most 32 characters. |
pUserRights | An integer equal to the sum of the rights allowed. |
If the userName argument is NULL, the function returns the rights of the current user.
The return value is a bit code for the rights allowed, as shown in the following table.
Code | User Rights |
---|---|
1 | Superuser (in which case the other bits don't matter). |
2 | Permission to alter the drawing set. |
4 | Permission to edit objects. |
8 | Permission to execute a draw query. |
16 | Permission to edit Feature Class definition. |
If the username argument is omitted or NULL, and there is no current user, the function returns a bit code with all bits set, because the no-current-user condition is possible only if the system option "ForceUserLogin" is set to NULL, in which case all users have all rights except those reserved for a superuser.
Only a superuser can specify a login name other than their own. If the username argument is not the login name of the current user, and the current user does not have superuser rights, the function returns NULL, and the message "Access is denied" is added to the error stack.