B2020-111 Limit where the Set Amin can create new folders

B2020-114 Fixed crash when Set Admin clicked on Admin Tools Links button
C2020-035 Don’t allow Set Admin run Repair tools and show only folders associated with Set Admin for the update Transition and RO links
This commit is contained in:
John Jenko 2020-10-08 19:39:41 +00:00
parent 33a3ec3940
commit 9953efd962

View File

@ -1089,7 +1089,7 @@ namespace VEPROMS.CSLA.Library
} }
public static bool CanCreateFolders(UserInfo myUserInfo, FolderInfo fi) public static bool CanCreateFolders(UserInfo myUserInfo, FolderInfo fi)
{ {
return myUserInfo != null && fi != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(fi); return myUserInfo != null && fi != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(fi.MyParent); //B2020-111 allow if set amin controls parent
} }
public bool IsAdministrator() public bool IsAdministrator()
{ {
@ -1108,9 +1108,12 @@ namespace VEPROMS.CSLA.Library
} }
return false; return false;
} }
public bool IsSetAdministrator(FolderInfo fi) //B2020-111, B2020-114, C2020-035 this was setting the passed in parameter, such that the first time this
// was called, the passed in parameter was set to the top node (VEPROMS). The check of other folders
// would then be skipped (from where is called)
public bool IsSetAdministrator(FolderInfo fldinf)
{ {
if (this.UserMembershipCount == 0) if (this.UserMembershipCount == 0 || fldinf == null)
return false; return false;
foreach (MembershipInfo mi in this.UserMemberships) foreach (MembershipInfo mi in this.UserMemberships)
{ {
@ -1118,6 +1121,7 @@ namespace VEPROMS.CSLA.Library
{ {
Dictionary<int, int> folders = new Dictionary<int, int>(); Dictionary<int, int> folders = new Dictionary<int, int>();
//FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID); //FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID);
FolderInfo fi = fldinf;
while (fi.FolderID > 1) while (fi.FolderID > 1)
{ {
folders.Add(fi.FolderID, fi.FolderID); folders.Add(fi.FolderID, fi.FolderID);