]> git.defcon.no Git - hermes/blobdiff - doc/api-nodes.txt
Permissions, a naive approach
[hermes] / doc / api-nodes.txt
index a3cafc99bed7291c1dcd2e79a24b63fe280471a5..56e2a0587a6c778773045d36bb1be16f07b2ffe0 100644 (file)
@@ -717,6 +717,59 @@ domain/set_servers
        'description' contains a text describing the actual fail.
        Return 'failed' with 'cause' = 'error' on database failure.
 
+permission/get
+-------------------
+  Required:
+       user=foo@bar.bz *
+
+  Description:
+       Gets the permissions value for a user, with no parsing. 
+       The permission system is based on bit-flags, with the following values:
+               NOCALLS        1
+               EMERGENCY      2 
+               INTERNAL       4
+               VOIP           8 
+               NATIONAL       16
+               SERVICES       32      
+               INTERNATIONAL  64      
+               OTHERS         128
+       The user must match a valid user registration.
+
+  Return:
+       Returns 'permission' set to the applied permission value on success.
+       Returns 'failed' with 'cause' = 'nonexistant' if user does not exist..
+       Returns 'failed' with 'cause' = 'dbfail' on database failure.
+
+
+permission/set
+-------------------
+  Required:
+       user=foo@bar.bz *
+       permission=63
+
+  Description:
+       Sets the permissions value for a user directly. The permission
+       system is based on bit-flags, with the following values:
+               NOCALLS        1
+               EMERGENCY      2 
+               INTERNAL       4
+               VOIP           8 
+               NATIONAL       16
+               SERVICES       32      
+               INTERNATIONAL  64      
+               OTHERS         128
+       To give a subscriber full permissions, set permission to 255.
+       To give a subscriber National calls, all internal and VOIP
+       calls, but not international, sat-phones and other, use 63.
+       To give a user emergency and internal, but no other calls,
+       the permission value becomes 7.
+       The user must match a valid user registration.
+
+  Return:
+       Returns 'permission' set to the applied permission value on success.
+       Returns 'failed' with 'cause' = 'dbfail' on database failure.
+
+
 BUGS:
 ---------------------