B2020-048: Check in of procedure was allowed by writer when should be administrator only
This commit is contained in:
		@@ -61,8 +61,13 @@ namespace VEPROMS
 | 
			
		||||
			sb.AppendLine();
 | 
			
		||||
			sb.AppendLine(string.Format("in a VEPROMS session on computer {0} that was started on {1}", MySessionInfo.MachineName, MySessionInfo.DTSDtart.ToString("MM/dd/yyyy @ HH:mm:ss")));
 | 
			
		||||
			lblInfo.Text = sb.ToString();
 | 
			
		||||
			if(MyProcedureInfo != null)
 | 
			
		||||
				btnForce.Visible = UserInfo.CanEdit(MyUserInfo,MyProcedureInfo.MyDocVersion) && MyOwnerInfo.OwnerItemID == MyProcedureInfo.ItemID;
 | 
			
		||||
			if (MyProcedureInfo != null)
 | 
			
		||||
			{
 | 
			
		||||
				// B2020-048: Only have force button visible if administrator or 'canedit' and current user is not a writer.
 | 
			
		||||
				bool writerAndOtherUserIsIn = !(MySessionInfo.UserID != MyUserInfo.UserID && MyUserInfo.IsWriter(MyProcedureInfo.MyDocVersion));
 | 
			
		||||
				bool isActiveAdministrator = MyUserInfo.IsAdministrator() || MyUserInfo.IsSetAdministrator(MyProcedureInfo.MyDocVersion);
 | 
			
		||||
				btnForce.Visible = isActiveAdministrator || (writerAndOtherUserIsIn && UserInfo.CanEdit(MyUserInfo, MyProcedureInfo.MyDocVersion));
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
				btnForce.Visible = MyUserInfo.IsAdministrator() || MyUserInfo.IsSetAdministrator(MySectionInfo.MyProcedure.MyDocVersion);
 | 
			
		||||
		}
 | 
			
		||||
@@ -77,4 +82,4 @@ namespace VEPROMS
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user