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 CanExport(string userId) { var canExport = false; var user = new PatUser(userId); if (user.IsAdmin()) { canExport = true; } else { if (CoordinatorCode == null) { CoordinatorCode = Coordinator; } if (userId.Equals(CoordinatorCode)) { canExport = true; } else { if (user.IsInAnyOfTheseGroups(ResourcesSetShort())) { canExport = true; } } } return(canExport); }
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); }