Exemplo n.º 1
0
		public DataRow InsertNewUserRoleForUser (User UserToProcess, UserRole UserRoleToAdd)
			{
			DataRow NewRow = SystemSecurityDataSet.Tables ["webpages_UsersInRoles"].NewRow();
			NewRow ["ID"] = System.Guid.NewGuid();
			NewRow ["UserID"] = UserToProcess.UserID;
			NewRow ["RoleID"] = UserRoleToAdd.RoleID;
			SystemSecurityDataSet.Tables ["webpages_UsersInRoles"].Rows.Add(NewRow);
			UpdateSystemSecurityDataSet();
			return NewRow;
			}
Exemplo n.º 2
0
	    public void RemoveRoleFromUser (User UserToProcess, UserRole UserRoleToRemoveFromUser)
		    {
			if (!(UserToProcess.RolesForThisUser.Contains(UserRoleToRemoveFromUser)))
				return;
			SecuringDirectoryDataWrapper.Instance.RemoveUserRoleFromUser(UserToProcess.UserID, UserRoleToRemoveFromUser.RoleID);
		    }
Exemplo n.º 3
0
	    public void ChangeUserRoleColor (UserRole UserRoleToChangeColor, String NewColor)
		    {
		    UserRoleToChangeColor.BrushName = NewColor;
			SecuringDirectoryDataWrapper.Instance.UpdateSystemSecurityDataSet();
			}
Exemplo n.º 4
0
	    public void AddNewRoleToUser (User UserToProcess, UserRole UserRoleToAdd)
		    {
		    if (UserToProcess.RolesForThisUser.Contains(UserRoleToAdd))
			    return;
		    DataRow UserInRoleRow = SecuringDirectoryDataWrapper.Instance.InsertNewUserRoleForUser
			    (UserToProcess, UserRoleToAdd);
		    UserToProcess.RolesForThisUser.Add(UserRoleToAdd);
			UsersInRoles.Add( new UserInRole(this, UserInRoleRow));
		    }
Exemplo n.º 5
0
	    public void DeleteUserRole (UserRole EntryToDelete)
		    {
			int RoleID = EntryToDelete.RoleID;
		    foreach (UserInRole UserInRoleEntry in UsersInRoles)
			    {
			    if (UserInRoleEntry.RoleID == RoleID)
				    UserInRoleEntry.BasisRow.Delete();
			    }
			SecuringDirectoryDataWrapper.Instance.UpdateSystemSecurityDataSet();
		    foreach (User UserEntry in Users)
			    {
			    UserEntry.RolesForThisUser.Remove(EntryToDelete);
			    }
		    EntryToDelete.BasisRow.Delete();
			SecuringDirectoryDataWrapper.Instance.UpdateSystemSecurityDataSet();
		    }