예제 #1
0
        private EnterpriseManagementObject[] GetScopeItems(Guid type, UserRoleScope scope)
        {
            ManagementPackClass managementPackClass = _mg.EntityTypes.GetClass(type);

            return((from q in _mg.EntityObjects.GetObjectReader <EnterpriseManagementObject>(managementPackClass, ObjectQueryOptions.Default)
                    where scope.Objects.Contains(q.Id)
                    select q).ToArray <EnterpriseManagementObject>());
        }
예제 #2
0
파일: Role.cs 프로젝트: pastperfect/SMLets
 public Role(EnterpriseManagementGroup mg, UserRoleTypeEnum roleType)
 {
     if (mg == null)
     {
         throw new ArgumentNullException("mg");
     }
     this.existing        = false;
     this.managementGroup = mg;
     this.userRole        = new Microsoft.EnterpriseManagement.Security.UserRole();
     this.userRole.Name   = string.Format(CultureInfo.InvariantCulture, "{0}.{1}", new object[] { "UserRole", Guid.NewGuid() });
     this.profile         = this.GetProfile(mg, roleType.ToString());
     this.scope           = new UserRoleScope();
 }
예제 #3
0
파일: Role.cs 프로젝트: pastperfect/SMLets
 public Role(Microsoft.EnterpriseManagement.Security.UserRole existingRole)
 {
     if (existingRole == null)
     {
         throw new ArgumentNullException("existingRole");
     }
     this.existing        = true;
     this.managementGroup = existingRole.ManagementGroup;
     this.userRole        = existingRole;
     this.profile         = existingRole.Profile;
     this.scope           = existingRole.Scope;
     this.RetrieveValues();
 }