AcUtils
A high performance abstraction layer for AccuRev
|
A user's AccuRev principal attributes name, ID, and status (active or inactive). In addition, the user's AccuRev group membership list along with regular and other user properties from Active Directory can be included (both optional) during list construction. More...
Public Member Functions | |
string | ToString (string format, IFormatProvider provider) |
The ToString implementation. More... | |
string | getGroups () |
Get the list of groups this user is a member of as a formatted string. List optionally initialized by AcUsers constructor when includeGroupsList param is true. More... | |
Equality comparison | |
bool | Equals (AcUser other) |
IEquatable implementation to determine the equality of instances of type AcUser. Uses the user's principal ID to compare instances as this number is immutable in AccuRev; a user's principal attributes can change except their ID. More... | |
override bool | Equals (object other) |
Overridden to determine equality. More... | |
override int | GetHashCode () |
Override appropriate for type AcUser. More... | |
Internal Functions | |
AcUser (int id, string name, PrinStatus status) | |
Initialize user's AccuRev principal attributes name, ID, and status (active or inactive). AcUser objects are instantiated during AcUsers list construction. This constructor is called internally and not by user code. More... | |
async Task< bool > | initFromADAsync (DomainCollection dc, PropCollection pc=null) |
Optionally called during list construction to initialize the default set of regular user properties and others from Active Directory. This method is called internally and not by user code. More... | |
async Task< bool > | initGroupsListAsync () |
Optionally called during list construction to initialize the list of groups this user is a member of 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. This method is called internally and not by user code. More... | |
Properties | |
AcPrincipal | Principal [get] |
AccuRev principal attributes name, ID, and status (active or inactive), and optionally their group membership list as per AcUsers constructor includeGroupsList parameter. More... | |
IDictionary< string, object > | Other [get] |
Additional Active Directory user properties not in the regular default set. More... | |
User properties default set (Active Directory) | |
string | GivenName [get] |
User's given name from Active Directory, e.g. John More... | |
string | MiddleName [get] |
User's middle name from Active Directory. More... | |
string | Surname [get] |
User's surname from Active Directory, e.g. Doe More... | |
string | DisplayName [get] |
User's display name from Active Directory, e.g. Doe, John More... | |
string | Business [get] |
User's business phone number from Active Directory. More... | |
string | EmailAddress [get] |
User's email address from Active Directory. More... | |
string | Description [get] |
User's description from Active Directory. More... | |
string | DistinguishedName [get] |
User's distinguished name from Active Directory. More... | |
Order comparison | |
int | CompareTo (AcUser other) |
Generic IComparable implementation (default) for comparing AcUser objects to sort by DisplayName from Active Directory if available, otherwise their AccuRev principal name. More... | |
int IComparable. | CompareTo (object other) |
Pre-generic interface implementation for code using reflection. More... | |
A user's AccuRev principal attributes name, ID, and status (active or inactive). In addition, the user's AccuRev group membership list along with regular and other user properties from Active Directory can be included (both optional) during list construction.
Definition at line 37 of file AcUsers.cs.
|
inlinepackage |
Initialize user's AccuRev principal attributes name, ID, and status (active or inactive). AcUser objects are instantiated during AcUsers list construction. This constructor is called internally and not by user code.
id | User's AccuRev principal ID number. |
name | User's AccuRev principal name. |
status | Whether the user is active or inactive in AccuRev. |
Definition at line 62 of file AcUsers.cs.
Referenced by AcUtils.AcUser.CompareTo().
|
inline |
Generic IComparable implementation (default) for comparing AcUser objects to sort by DisplayName from Active Directory if available, otherwise their AccuRev principal name.
other | An AcUser object to compare with this instance. |
Definition at line 119 of file AcUsers.cs.
Referenced by AcUtils.AcUser.CompareTo().
|
inlineprivate |
Pre-generic interface implementation for code using reflection.
other | An AcUser object to compare with this instance. |
ArgumentException | thrown if argument is not an AcUser object. |
Definition at line 141 of file AcUsers.cs.
|
inline |
IEquatable implementation to determine the equality of instances of type AcUser. Uses the user's principal ID to compare instances as this number is immutable in AccuRev; a user's principal attributes can change except their ID.
other | The AcUser object being compared to this instance. |
Definition at line 79 of file AcUsers.cs.
Referenced by AcUtils.AcUser.Equals().
|
inline |
Overridden to determine equality.
Definition at line 90 of file AcUsers.cs.
|
inline |
Get the list of groups this user is a member of as a formatted string. List optionally initialized by AcUsers constructor when includeGroupsList param is true.
Definition at line 476 of file AcUsers.cs.
|
inline |
Override appropriate for type AcUser.
Definition at line 102 of file AcUsers.cs.
|
inlinepackage |
Optionally called during list construction to initialize the default set of regular user properties and others from Active Directory. This method is called internally and not by user code.
dc | List of DomainElement objects as defined in <prog_name>.exe.config domains section. Used to initialize the user properties default set from Active Directory. |
pc | List of PropElement objects as defined in <prog_name>.exe.config properties section. Used to add and initialize user properties from Active Directory that are outside the regular default set. |
Exception | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on failure to handle a range of exceptions. |
Definition at line 361 of file AcUsers.cs.
Referenced by AcUtils.AcUsers.initUserPropsAsync().
|
inlinepackage |
Optionally called during list construction to initialize the list of groups this user is a member of 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. This method is called internally and not by user code.
Membership lists for inactive users are initialized too when constructor parameter includeDeactivated is true.
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 -u <user> groups
show
command used here, its show -fx -g <group> members
counterpart does not include memberships resulting from indirect (implicit) membership. Definition at line 434 of file AcUsers.cs.
Referenced by AcUtils.AcUsers.initUserPropsAsync().
|
inline |
The ToString implementation.
format | The format specifier to use, e.g. Console.WriteLine(user.ToString("e")); |
provider | Allow clients to format output for their own types using ICustomFormatter. |
FormatException | thrown if an invalid format string is specified. |
G
User's display name from Active Directory if available (e.g. Doe, John), otherwise their AccuRev principal name. The default when no format specifier is used. LV
Long version (verbose). I
User's AccuRev principal ID number. N
User's AccuRev principal name. S
Principal's status in AccuRev: Active or Inactive. F
User's given name from Active Directory. M
User's middle name from Active Directory. L
User's surname from Active Directory. DN
User's display name from Active Directory. B
User's business phone number from Active Directory. E
User's email address from Active Directory. D
User's description from Active Directory. DG
User's distinguished name from Active Directory. Definition at line 289 of file AcUsers.cs.
|
get |
User's business phone number from Active Directory.
Definition at line 199 of file AcUsers.cs.
|
get |
User's description from Active Directory.
Definition at line 215 of file AcUsers.cs.
|
get |
User's display name from Active Directory, e.g. Doe, John
Definition at line 191 of file AcUsers.cs.
Referenced by AcUtils.AcUser.CompareTo().
|
get |
User's distinguished name from Active Directory.
Definition at line 223 of file AcUsers.cs.
|
get |
User's email address from Active Directory.
Definition at line 207 of file AcUsers.cs.
|
get |
User's given name from Active Directory, e.g. John
Definition at line 167 of file AcUsers.cs.
|
get |
User's middle name from Active Directory.
Definition at line 175 of file AcUsers.cs.
|
get |
Additional Active Directory user properties not in the regular default set.
Optionally initialized during list construction for user properties beyond the default set. Elements are [title,value] pairs: title from the properties section in <prog_name>.exe.config
and its value from Active Directory.
Definition at line 263 of file AcUsers.cs.
|
get |
AccuRev principal attributes name, ID, and status (active or inactive), and optionally their group membership list as per AcUsers constructor includeGroupsList parameter.
Definition at line 157 of file AcUsers.cs.
Referenced by AcUtils.AcDepots.canViewAsync(), AcUtils.AcUser.CompareTo(), AcUtils.AcUser.getGroups(), AcUtils.AcUser.GetHashCode(), AcUtils.AcUser.initFromADAsync(), and AcUtils.AcUser.initGroupsListAsync().
|
get |
User's surname from Active Directory, e.g. Doe
Definition at line 183 of file AcUsers.cs.