public bool CanEditCheckList(string userId) { var canAdd = false; var user = new PatUser(userId); if (user.IsAdministrator()) { canAdd = true; } else { if (CoordinatorCode == null) { CoordinatorCode = Coordinator; } if (userId.Equals(CoordinatorCode) || userId.Equals(CreatedBy)) { canAdd = true; } else { if (user.IsInAnyOfTheseGroups(ResourcesSetShort())) { canAdd = true; } } } return(canAdd); }
public bool CanAddUpload(string userId, int nContracts) { var canAddUpload = false; if (!IsContractMonitoringOrContractSiteVisit()) { if (nContracts > 0) { var user = new PatUser(userId); if (user.IsAdministrator()) { canAddUpload = true; } else { if (CoordinatorCode == null) { CoordinatorCode = Coordinator; } if (userId.Equals(CoordinatorCode)) { canAddUpload = true; } else { if (user.IsInAnyOfTheseGroups(ResourcesSetShort())) { canAddUpload = true; } } } } } return(canAddUpload); }
public bool CanEdit(PatUser user, string resourceSet) { var canEdit = false; if (user.IsAdministrator()) { canEdit = true; } else { if (user.IsInAnyOfTheseGroups(resourceSet)) { canEdit = true; } } return(canEdit); }
public bool CanEdit(PatUser user) { return(CanEdit(user.LoginName, user.IsAdministrator())); }
public bool CanDelete(PatUser user) { return(user.IsAdministrator()); }