Add auth_cred_is_unrestricted
This commit is contained in:
parent
7bda215ad4
commit
c15f201d70
@ -19,6 +19,25 @@
|
|||||||
|
|
||||||
#include "uhub.h"
|
#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)
|
int auth_cred_is_protected(enum auth_credentials cred)
|
||||||
{
|
{
|
||||||
switch (cred)
|
switch (cred)
|
||||||
|
@ -35,6 +35,12 @@ enum auth_credentials
|
|||||||
auth_cred_admin, /**<<< "User is identified as a hub administrator/owner" */
|
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 1 if the credentials means that a user is protected.
|
||||||
* Returns 0 otherwise.
|
* Returns 0 otherwise.
|
||||||
|
Loading…
Reference in New Issue
Block a user