示例#1
0
        public void ReplaceUsersInRole(ClientGenericObject[] users, ClientAdminUnit unit, ClientAUSchemaRole role)
        {
            users.NullCheck("users"); unit.NullCheck("unit"); role.NullCheck("role");
            CheckIDProvided(unit); CheckIDProvided(role);
            SCUser[] scUsers = new SCUser[users.Length];
            for (int i = users.Length - 1; i >= 0; i--)
            {
                scUsers[i] = (SCUser)users[i].ToSchemaObject();
            }

            this.Facade.ReplaceUsersInRole(scUsers, (AdminUnit)unit.ToSchemaObject(), (AUSchemaRole)role.ToSchemaObject());
        }
示例#2
0
        public void RemoveUserFromRole(ClientGenericObject user, ClientAdminUnit unit, ClientAUSchemaRole role)
        {
            user.NullCheck("user"); unit.NullCheck("unit"); role.NullCheck("role");
            CheckIDProvided(user); CheckIDProvided(unit); CheckIDProvided(role);

            SCUser scUser = new SCUser()
            {
                ID       = user.ID,
                Name     = user.Properties.GetValue("Name", string.Empty),
                CodeName = user.Properties.GetValue("CodeName", string.Empty)
            };

            this.Facade.RemoveUserFromRole(scUser, (AdminUnit)unit.ToSchemaObject(), (AUSchemaRole)role.ToSchemaObject());
        }
示例#3
0
 public void UpdateAdminSchemaRole(ClientAUSchemaRole role)
 {
     CheckIDProvided(role);
     this.Facade.UpdateAdminSchemaRole((AUSchemaRole)role.ToSchemaObject(true));
 }
示例#4
0
        public void AddUserToRole(ClientGenericObject user, ClientAdminUnit unit, ClientAUSchemaRole role)
        {
            user.NullCheck("user"); unit.NullCheck("unit"); role.NullCheck("role");
            CheckIDProvided(user); CheckIDProvided(unit); CheckIDProvided(role);

            if (string.IsNullOrEmpty(user.ID))
            {
                throw new ArgumentException("user的ID必须不为null", "user");
            }

            SCUser scUser = new SCUser()
            {
                ID       = user.ID,
                Name     = user.Properties.GetValue("Name", string.Empty),
                CodeName = user.Properties.GetValue("CodeName", string.Empty)
            };

            this.Facade.AddUserToRole(scUser, (AdminUnit)unit.ToSchemaObject(), (AUSchemaRole)role.ToSchemaObject());
        }
示例#5
0
 public void AddAdminSchemaRole(ClientAUSchemaRole role, ClientAUSchema schema)
 {
     CheckIDProvided(schema);
     EnsureID(role);
     this.Facade.AddAdminSchemaRole((AUSchemaRole)role.ToSchemaObject(false), (AUSchema)schema.ToSchemaObject(true));
 }