public bool IsAuthorized() { if (!AgencyLogic.IsAgencyUserActive(ViewData.AgencyId, AccountInfo.UserId)) { return(false); } ReviewerUserId = (Logic.IsUserClientContactReviewer(ViewData.Id, AccountInfo.UserId)) ? (int?)AccountInfo.UserId : null; if (ViewData.SubmitterUserId == AccountInfo.UserId || ViewData.CounselorUserId == AccountInfo.UserId) { return(true); } var descriptors = UserBLL.GetDescriptorsForUser(AccountInfo.UserId, ViewData.AgencyId); foreach (var descriptor in descriptors) { if (descriptor == (int)Descriptor.DataSubmitter || descriptor == (int)Descriptor.ShipDirector) { return(true); } } return(ReviewerUserId.HasValue); }
public bool IsAuthorized() { if (AccountInfo.IsCMSLevel == true) { return(true); } //for cms or shipDirector return true so that they can see the delete button if (ApproverRulesBLL.IsApproverAtCMS(this.AccountInfo) || this.AccountInfo.IsShipDirector) { return(true); } if (!AgencyLogic.IsAgencyUserActive(ViewData.AgencyId, AccountInfo.UserId)) { return(false); } ReviewerUserId = (Logic.IsUserClientContactReviewer(ViewData.Id, AccountInfo.UserId)) ? (int?)AccountInfo.UserId : null; if (ViewData.SubmitterUserId == AccountInfo.UserId || ViewData.CounselorUserId == AccountInfo.UserId) { return(true); } var descriptors = UserBLL.GetDescriptorsForUser(AccountInfo.UserId, ViewData.AgencyId); foreach (var descriptor in descriptors) { if (descriptor == (int)Descriptor.DataSubmitter || descriptor == (int)Descriptor.ShipDirector) { return(true); } } return(ReviewerUserId.HasValue); }