Difference between revisions of "PermissionAudit class"

From Catglobe Wiki
Jump to: navigation, search
Line 2: Line 2:
 
|Name=<nowiki>PermissionAudit</nowiki>
 
|Name=<nowiki>PermissionAudit</nowiki>
 
|Description=<nowiki>Auditing permissions</nowiki>
 
|Description=<nowiki>Auditing permissions</nowiki>
|Constructors=
+
|InheritsFrom=object|Constructors=
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=Unknown|Name=<nowiki>resourceIds</nowiki>|Description=<nowiki>Ids of the resources to check access to</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Unknown|Name=<nowiki>userResourceIds</nowiki>|Description=<nowiki>Ids of the user to calculate permissions for</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Unknown|Name=<nowiki>groupResourceIds</nowiki>|Description=<nowiki>Ids of the user to calculate permissions for</nowiki>}}
+
{{CGscriptParameters_Template|Type=Array of ints|Name=<nowiki>resourceIds</nowiki>|Description=<nowiki>Ids of the resources to check access to</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Array of ints|Name=<nowiki>userResourceIds</nowiki>|Description=<nowiki>Ids of the user to calculate permissions for</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Array of ints|Name=<nowiki>groupResourceIds</nowiki>|Description=<nowiki>Ids of the user to calculate permissions for</nowiki>}}
 
|Description=<nowiki>Calculate the permissions on resources by the given groups and users</nowiki>}}
 
|Description=<nowiki>Calculate the permissions on resources by the given groups and users</nowiki>}}
 
|Methods=
 
|Methods=
Line 10: Line 10:
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>resourceId</nowiki>|Description=<nowiki>Id of the resource to check access to</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>userResourceId</nowiki>|Description=<nowiki>User to check permission for</nowiki>}}
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>resourceId</nowiki>|Description=<nowiki>Id of the resource to check access to</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>userResourceId</nowiki>|Description=<nowiki>User to check permission for</nowiki>}}
 
|Description=<nowiki>Get the actual permission given to a given resource by the given user</nowiki>}}
 
|Description=<nowiki>Get the actual permission given to a given resource by the given user</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}}
+
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
 
|Properties=
 
|Properties=
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
 
}}
 
}}
 +
 
=== <span style="color:#DF8621">'''Examples'''</span> ===
 
=== <span style="color:#DF8621">'''Examples'''</span> ===
 
<source lang="javascript">
 
<source lang="javascript">

Revision as of 06:21, 2 July 2020

PermissionAudit



Auditing permissions

Parent class

Inherits from object

Constructors

  • (Array of int resourceIds "Ids of the resources to check access to", Array of int userResourceIds "Ids of the user to calculate permissions for", Array of int groupResourceIds "Ids of the user to calculate permissions for") - Calculate the permissions on resources by the given groups and users

Methods

  • int GetEffectivePermissionForUser(int resourceId "Id of the resource to check access to", int userResourceId "User to check permission for") - Get the actual permission given to a given resource by the given user
  • (From object) string ToString() - The string representation of the object.

Properties

  • string ObjectTypeName { get; } - The name of the type of object.
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.


Examples

number resourceRId = 15860101;
number userRId = 15864858;
number groupRId = 15729111;
PermissionAudit perAudit = new PermissionAudit ({resourceRId},{userRId},{groupRId});
print(perAudit.GetEffectivePermissionForUser(resourceRId,userRId));
//Result return:
//0: None (Resource_Permission_None)
//2: Read (Resource_Permission_Read)
//4: Write (Resource_Permission_Write)
//6: FullControl (Resource_Permission_FullControl)