Пример #1
0
 internal void DeleteRoleAssignment(AzRoleAssignment roleAssignment)
 {
     if (roleAssignment == null)
     {
         return;
     }
     RoleAssignments.Remove(roleAssignment);
     IAzScope.DeleteRole(roleAssignment.Name);
     HasChanged = true;
 }
Пример #2
0
        internal AzRoleAssignment GetOrCreateAzRoleAssignment(string name)
        {
            var role = RoleAssignments[name];

            if (role != null)
            {
                return(role);
            }

            var azRole = IAzScope.CreateRole(name);

            azRole.Submit();

            role = new AzRoleAssignment {
                IAzItem = azRole
            };
            RoleAssignments.Add(role);

            HasChanged = true;
            return(role);
        }