コード例 #1
0
        public void ResetBypassMode()
        {
            TisRole adminRole =
                (TisRole)Roles.GetByName(TisRole.BUILTIN_ADMINISTRATORS_ROLE);

            adminRole.RemoveCurrentUser();
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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();
                }
            }
        }