Add auth_cred_is_unrestricted

This commit is contained in:
klondike 2014-04-04 05:06:14 +02:00 committed by Francisco Blas (klondike) Izquierdo Riera
parent 7bda215ad4
commit c15f201d70
2 changed files with 25 additions and 0 deletions

View File

@ -19,6 +19,25 @@
#include "uhub.h"
/**
* Returns 1 if a user is unrestricted.
* Unrestricted users override the limits of flood and can send messages in
* the name of other users.
* This is useful for amongst other external chatrooms.
*/
int auth_cred_is_unrestricted(enum auth_credentials cred)
{
switch (cred)
{
case auth_cred_ubot:
case auth_cred_opubot:
return 1;
default:
break;
}
return 0;
}
int auth_cred_is_protected(enum auth_credentials cred)
{
switch (cred)

View File

@ -35,6 +35,12 @@ enum auth_credentials
auth_cred_admin, /**<<< "User is identified as a hub administrator/owner" */
};
/**
* Returns 1 if the credentials means that a user is unrestricted.
* Returns 0 otherwise.
*/
int auth_cred_is_unrestricted(enum auth_credentials cred);
/**
* Returns 1 if the credentials means that a user is protected.
* Returns 0 otherwise.