AcUtils
A high performance abstraction layer for AccuRev
|
A container class for AcPrincipal objects that define AccuRev groups. More...
Public Member Functions | |
AcPrincipal | getPrincipal (string name) |
Retrieves the AcPrincipal object for AccuRev group name. More... | |
string | getMembers (string group) |
Returns the list of members in group as a formatted string. List optionally initialized by AcGroups constructor when includeMembersList param is true. More... | |
Two-part object construction: | |
AcGroups (bool includeMembersList=false, bool includeDeactivated=false) | |
A container class for AcPrincipal objects that define AccuRev groups. Elements contain AccuRev group principal attributes name, ID, and status (active or inactive), and optionally their members list. Including group membership (includeMembersList = true) is slower, so we give the option to exclude it when the list isn't needed. Deactivated (removed) groups can be included in the list as well. More... | |
async Task< bool > | initAsync (IProgress< int > progress=null) |
Populate this container with AcPrincipal objects as per constructor parameters. More... | |
Static Public Member Functions | |
static bool | isMember (string user, string group) |
Determines if user is a member of group by way of direct or indirect (implicit) membership, e.g. Mary is implicitly a member of groupA because she's a member of groupB which is a member of groupA. More... | |
Private Member Functions | |
async Task< bool > | initMembersListAsync (string group) |
Optionally called during list construction to initialize the list of principals (users and groups) that are direct (explicit) members of group. This method is called internally and not by user code. More... | |
A container class for AcPrincipal objects that define AccuRev groups.
Elements contain AccuRev group principal attributes name, ID, and status (active or inactive), and optionally their members list. Deactivated (removed) groups can be included in the list as well.
Definition at line 37 of file AcGroups.cs.
|
inline |
A container class for AcPrincipal objects that define AccuRev groups. Elements contain AccuRev group principal attributes name, ID, and status (active or inactive), and optionally their members list. Including group membership (includeMembersList = true) is slower, so we give the option to exclude it when the list isn't needed. Deactivated (removed) groups can be included in the list as well.
A group's membership list is comprised of principals (users and groups) who were explicitly added to the group by the addmember
command and not those with implicit membership, i.e. if principal is a member of groupA and groupA is a member of groupB, principal is implicitly a member of groupB. In this case the principal would not appear in groupB's members list.
includeMembersList | true to include group membership initialization for each group (slower), false for no initialization (faster). |
includeDeactivated | true to include deactivated (removed) groups, otherwise false. |
Definition at line 91 of file AcGroups.cs.
|
inline |
Returns the list of members in group as a formatted string. List optionally initialized by AcGroups constructor when includeMembersList param is true.
group | AccuRev group name to query. |
Definition at line 311 of file AcGroups.cs.
|
inline |
Retrieves the AcPrincipal object for AccuRev group name.
name | AccuRev group name to query. |
Definition at line 299 of file AcGroups.cs.
Referenced by AcUtils.AcGroups.getMembers(), and AcUtils.AcGroups.initMembersListAsync().
|
inline |
Populate this container with AcPrincipal objects as per constructor parameters.
progress | Optionally report progress back to the caller when group membership initialization is requested as per constructor parameter includeMembersList. |
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on show command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
show <-fx | -fix> groups
Definition at line 107 of file AcGroups.cs.
|
inlineprivate |
Optionally called during list construction to initialize the list of principals (users and groups) that are direct (explicit) members of group. This method is called internally and not by user code.
Membership lists for inactive groups are empty (not initialized). An inactive group's membership list will reappear when the group is reactivated.
group | Name of AccuRev group. |
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on show command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
show -fx -g <group> members
show
command used here, its show -fx -u <user> groups
counterpart does include memberships resulting from indirect (implicit) membership. Definition at line 187 of file AcGroups.cs.
Referenced by AcUtils.AcGroups.initAsync().
|
inlinestatic |
Determines if user is a member of group by way of direct or indirect (implicit) membership, e.g. Mary is implicitly a member of groupA because she's a member of groupB which is a member of groupA.
user | AccuRev principal name of user. |
group | AccuRev principal name of group. |
AcUtilsException | thrown on AccuRev program invocation failure for the ismember command. |
Win32Exception | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on error spawning the AccuRev process that runs the command. |
InvalidOperationException | caught and logged in same on failure to handle a range of exceptions. |
ismember <user> <group>
ismember
is zero (0) whether the user is a member of the group or not. It is the command's output (STDOUT) that is "1" (one) if the user is a member of the group or "0" (zero) if not a member.ismember
to prevent an endless recursive loop. Definition at line 242 of file AcGroups.cs.