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(); }
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(); }