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:
Markus Mäkelä
2017-08-14 14:08:31 +03:00
parent c323f0a551
commit 06afbd14eb
2 changed files with 101 additions and 6 deletions

View File

@ -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
*