Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

PermissionAudit class: Difference between revisions

From Catglobe Wiki
Created page with "{{CGscriptClass_Template |Name=<nowiki>PermissionAudit</nowiki> |Description=<nowiki>Auditing permissions</nowiki> |Constructors= {{CGscriptConstructors_Template|Parameters= {..."
 
No edit summary
Line 15: Line 15:
{{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|Description=<nowiki>Get information about this class.</nowiki>}}
}}
}}
=== <span style="color:#DF8621">'''Examples'''</span> ===
<source lang="javascript">
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)
</source>

Revision as of 04:37, 28 April 2020

PermissionAudit



Auditing permissions

Constructors

  • (Unknown resourceIds "Ids of the resources to check access to", Unknown userResourceIds "Ids of the user to calculate permissions for", Unknown 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
  • string ToString() - The string representation of the object.

Properties

  • string ObjectTypeName { get; } - The name of the type of 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)