コード例 #1
0
 void RefreshRolesForUserComboBox()
 {
     string[] roles = null;
     if (String.IsNullOrEmpty(UserToAssign) == false)
     {
         using (RoleManagerProxy roleManager = new RoleManagerProxy(ServiceAddress))
             roles = roleManager.GetRolesForUser(ApplicationName, UserToAssign);
     }
     m_RolesForUserComboBox.RefreshComboBox(UserToAssign, roles);
 }
コード例 #2
0
        void OnRemoveUsersFromAllRoles(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure you want to remove the user " + UserToAssign + " from all its roles?", "Credentials Manager", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

            if (result == DialogResult.OK)
            {
                using (RoleManagerProxy roleManager = new RoleManagerProxy(ServiceAddress))
                {
                    string[] roles = roleManager.GetRolesForUser(ApplicationName, UserToAssign);
                    if (roles.Length > 0)
                    {
                        roleManager.RemoveUserFromRoles(ApplicationName, UserToAssign, roles);
                        RefreshRolesForUserComboBox();
                        RefreshUsersForRoleComboBox();
                        RefreshRolePageButtons();
                    }
                }
            }
        }
コード例 #3
0
 void RefreshRolesForUserComboBox()
 {
    string[] roles = null;
    if(String.IsNullOrEmpty(UserToAssign) == false)
    {
       using(RoleManagerProxy roleManager = new RoleManagerProxy(ServiceAddress))
       roles = roleManager.GetRolesForUser(ApplicationName,UserToAssign);
    }
    m_RolesForUserComboBox.RefreshComboBox(UserToAssign,roles);        
 }
コード例 #4
0
 void OnRemoveUsersFromAllRoles(object sender,EventArgs e)
 {
    DialogResult result = MessageBox.Show("Are you sure you want to remove the user " + UserToAssign + " from all its roles?","Credentials Manager",MessageBoxButtons.OKCancel,MessageBoxIcon.Warning);
    if(result == DialogResult.OK)
    {
       using(RoleManagerProxy roleManager = new RoleManagerProxy(ServiceAddress))
       {
          string[] roles = roleManager.GetRolesForUser(ApplicationName,UserToAssign);
          if(roles.Length > 0)
          {
             roleManager.RemoveUserFromRoles(ApplicationName,UserToAssign,roles);
             RefreshRolesForUserComboBox();
             RefreshUsersForRoleComboBox();
             RefreshRolePageButtons();
          }
       }
    }
 }