public void ResetBypassMode() { TisRole adminRole = (TisRole)Roles.GetByName(TisRole.BUILTIN_ADMINISTRATORS_ROLE); adminRole.RemoveCurrentUser(); }
private TisRole[] ObtainCurrentRoles(USER_TYPE enUserType) { ArrayBuilder oRoles = new ArrayBuilder(typeof(TisRole)); foreach (KeyValuePair <string, ITisRole> kvp in m_oRoles) { TisRole oRole = (TisRole)m_oRoles[kvp.Key]; if (enUserType == USER_TYPE.USER) { if (oRole.ContainsCurrentSystemUser()) { oRoles.Add(oRole); } } else { if (oRole.ContainsCurrentSystemGroup()) { oRoles.Add(oRole); } } } return((TisRole[])oRoles.GetArray()); }
public TisRole AddRole(string sRoleName) { if (m_oRoles.ContainsKey(sRoleName)) { return((TisRole)m_oRoles [sRoleName]); } TisRole oRole = new TisRole(sRoleName, m_oSupportedPermissionsDelegate); oRole.OnRoleNameChanged += new RoleNameChangedDelegate(OnRoleNameChangedHandler); oRole.OnRoleSystemUserAdded += new RoleSystemUserAddedDelegate(OnRoleSystemUserAddedHandler); oRole.OnFindSystemUserInNetGroup += new SystemUserInNetGroupDelegate(OnFindSystemUserInNetGroupHandler); m_oRoles.Add(sRoleName, oRole); return(oRole); }
public void SetBypassMode(BYPASS_MODE bypassMode) { if (bypassMode == BYPASS_MODE.ADD_ADMIN_USER) { TisRole adminRole = (TisRole)Roles.GetByName(TisRole.BUILTIN_ADMINISTRATORS_ROLE); adminRole.AddCurrentUser(); } else { foreach (TisRole oRole in Roles.All) { oRole.SystemUsers.Clear(); } } }