MXS-1354: Take REST API authorization into use

GET requests are allowed for all users while POST, PATCH, DELETE and PUT
requests are reserved for administrative users.
This commit is contained in:
Markus Mäkelä
2017-08-14 14:15:50 +03:00
parent 06afbd14eb
commit a48758a9d8
2 changed files with 40 additions and 11 deletions

View File

@ -572,6 +572,18 @@ admin_verify_inet_user(const char *username, const char *password)
return rv;
}
bool admin_is_admin_user(const char* username)
{
bool rval = true; // The default `admin:mariadb` user has all permissions
if (inet_users)
{
rval = users_is_admin(inet_users, username);
}
return rval;
}
/**
* Print Linux and and inet users
*