MXS-1354: Add permissions to admin users
The admin users now have a concept of write and read permissions. This allows restricted read-only access to be granted to users.
This commit is contained in:
@ -88,6 +88,36 @@ bool users_auth(USERS* users, const char* user, const char* password);
|
||||
*/
|
||||
bool users_find(USERS* users, const char* user);
|
||||
|
||||
/**
|
||||
* Check if user is an administrator
|
||||
*
|
||||
* @param users The users table
|
||||
* @param user User to check
|
||||
*
|
||||
* @return True if user is an administrator
|
||||
*/
|
||||
bool users_is_admin(USERS* users, const char* user);
|
||||
|
||||
/**
|
||||
* Promote a user to an administrator
|
||||
*
|
||||
* @param users The users table
|
||||
* @param user User to promote
|
||||
*
|
||||
* @return True if user was found and promoted
|
||||
*/
|
||||
bool users_promote(USERS* users, const char* user);
|
||||
|
||||
/**
|
||||
* Demote an administrative user to a normal user
|
||||
*
|
||||
* @param users The users table
|
||||
* @param user User to demote
|
||||
*
|
||||
* @return True if user was found and demoted
|
||||
*/
|
||||
bool users_demote(USERS* users, const char* user);
|
||||
|
||||
/**
|
||||
* @brief Default user loading function
|
||||
*
|
||||
|
Reference in New Issue
Block a user