Class MacroIdentityOption
- Namespace
- CMS.MacroEngine
- Assembly
- CMS.MacroEngine.dll
Encapsulates identity option for macros.
public class MacroIdentityOption
- Inheritance
-
objectMacroIdentityOption
- Extension Methods
Remarks
When both IdentityName and UserName are specified, the identity name has precedence.
Properties
IdentityName
Name of macro identity to be used when signing by macro identity is desired.
public string IdentityName { get; set; }
Property Value
- string
- See Also
UserName
Name of user to be used when signing by user is desired.
public string UserName { get; set; }
Property Value
- string
Methods
FromUserInfo(IUserInfo)
Creates a new identity option from user info.
public static MacroIdentityOption FromUserInfo(IUserInfo userInfo)
Parameters
userInfo
IUserInfo
Returns
GetEffectiveUser()
Gets effective user of macro identity identified by IdentityName when its value is provided. Otherwise gets user identified by UserName.
public IUserInfo GetEffectiveUser()
Returns
- IUserInfo
Returns user to be used when evaluating a macro, or null.
Remarks
This method returns null when IdentityName is provided, but the corresponding signature either does not exists or its MacroIdentityEffectiveUserID is not set.
IsNullOrEmpty(MacroIdentityOption)
Indicates whether identityOption
is null or both its IdentityName and UserName properties are null or empty.
public static bool IsNullOrEmpty(MacroIdentityOption identityOption)
Parameters
identityOption
MacroIdentityOptionIdentity option to be checked for null or emptiness.
Returns
- bool
Returns true when
identityOption
is null or when both its identity name and user name are null or empty strings.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.