AcUtils
A high performance abstraction layer for AccuRev
Properties | List of all members
AcUtils.AcPermissions Class Reference

A container of AcPermission objects that define AccuRev access control list (ACL) entries. More...

Collaboration diagram for AcUtils.AcPermissions:
Collaboration graph
[legend]

Public Member Functions

Two-part object construction:
 AcPermissions (PermKind kind)
 A container of AcPermission objects that define AccuRev access control list (ACL) entries. More...
 
async Task< bool > initAsync (string name=null)
 Populate this container with AcPermission objects. More...
 

Properties

PermKind Kind [get, set]
 Whether the list of permissions held pertain to depots or streams. More...
 

Detailed Description

A container of AcPermission objects that define AccuRev access control list (ACL) entries.

Definition at line 329 of file AcPermissions.cs.

Constructor & Destructor Documentation

AcUtils.AcPermissions.AcPermissions ( PermKind  kind)
inline

A container of AcPermission objects that define AccuRev access control list (ACL) entries.

// get the list of permissions for all depots
AcPermissions permissions = new AcPermissions(PermKind.depot);
if (!(await permissions.initAsync())) return false;
// show permissions on depots JUPITER and NEPTUNE
IEnumerable<AcPermission> filter = permissions.Where(n => n.Name.Equals("NEPTUNE") || n.Name.Equals("JUPITER"));
foreach (AcPermission permission in filter.OrderBy(n => n)) // use default comparer
Console.WriteLine(permission);
...
Permission on JUPITER depot applies to group Admin {all, inherit}
Permission on JUPITER depot applies to anyuser {all, no inherit}
Permission on JUPITER depot applies to group IT-Reporting {none, no inherit}
Permission on JUPITER depot applies to group PAT {all, inherit}
Permission on JUPITER depot applies to user robert {all, no inherit}
Permission on NEPTUNE depot applies to group Admin {all, inherit}
Permission on NEPTUNE depot applies to user barnyrd {all, inherit}
Permission on NEPTUNE depot applies to group IT-Reporting {none, no inherit}
Permission on NEPTUNE depot applies to group Omnipotent {none, inherit}
Permission on NEPTUNE depot applies to group PAT {all, inherit}
See also
initAsync, default comparer, AcDepots.canViewAsync, ShowPermissions.cs

Definition at line 375 of file AcPermissions.cs.

Member Function Documentation

async Task<bool> AcUtils.AcPermissions.initAsync ( string  name = null)
inline

Populate this container with AcPermission objects.

Parameters
nameOptional depot or stream name as per constructor parameter kind, otherwise all.
Returns
true if no failure occurred and list was initialized successfully, false otherwise.
Exceptions
AcUtilsExceptioncaught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on lsacl command failure.
Exceptioncaught and logged in same on failure to handle a range of exceptions.
See also
AcPermissions constructor
lsacl command:
lsacl -fx {stream|depot} <name>

Definition at line 391 of file AcPermissions.cs.

Property Documentation

PermKind AcUtils.AcPermissions.Kind
getset

Whether the list of permissions held pertain to depots or streams.

Definition at line 340 of file AcPermissions.cs.