public void CheckReadOnlyAccess() { try { AZManager azManager = new AZManager(); AZOperation[] azOP = azManager.CheckAccessById(_view.Username, _view.Domain, new Globals.Security.Operations[] { Globals.Security.Operations.AlterJob }); if (!azOP[0].Result) _view.ReadyOnlyJobRecords = true; else _view.ReadyOnlyJobRecords = false; } catch (Exception ex) { Logger.Write(string.Format("There was an error while trying to verify user permissions to update Job Information!\n{0}\n{1}", ex.InnerException, ex.StackTrace)); _view.DisplayMessage("There was an error while trying to verify user permissions to update Job Information.", false); } }
/// <summary> /// Check user permissions to enable/disable buttons /// </summary> public void CheckPermissions() { try { AZManager azManager = new AZManager(); AZOperation[] azOP = azManager.CheckAccessById(_view.Username, _view.Domain, new Globals.Security.Operations[] { Globals.Security.Operations.CreateJobRecord, Globals.Security.Operations.ManageCallCriteria, Globals.Security.Operations.FirstAlert, Globals.Security.Operations.Permiting, Globals.Security.Operations.Route }); if (null != azOP && azOP.Length > 0) { _view.EnableNewJobButton = azOP[0].Result; _view.EnableNewCallCriteria = azOP[1].Result; _view.EnableFirstAlertLink = azOP[2].Result; _view.EnablePermitingNotification = azOP[3].Result; } } catch (Exception ex) { Logger.Write(string.Format("There was an error while trying to verify User Permissions to enable New Job Button!\n{0}\n{1}", ex.Message, ex.StackTrace)); _view.DisplayMessage("There was an error while trying to verify User Permissions to enable New Job Button.", false); } }
public void VerifyAccess() { try { AZManager azManager = new AZManager(); AZOperation[] azOP = azManager.CheckAccessById(_view.UserName, _view.Domain, new Globals.Security.Operations[] { Globals.Security.Operations.Subcontractor }); if (!azOP[0].Result) { _view.ReadOnly = true; } } catch (Exception ex) { Logger.Write(string.Format("An error has ocurred while trying to verify Permissions!\n{0}\n{1}", ex.Message, ex.StackTrace)); _view.DisplayMessage("An error ocurred while trying to verify Permissions.", false); } }
public void VerifyAccess() { try { AZManager azManager = new AZManager(); AZOperation[] azOP = azManager.CheckAccessById(_view.UserName, _view.Domain, new Globals.Security.Operations[] { Globals.Security.Operations.Route }); if (!azOP[0].Result) _view.ReadOnly = true; } catch (Exception ex) { Logger.Write(string.Format("An Error has ocurred while trying to verify access to page.\n{0}\n{1}", ex.Message, ex.StackTrace)); _view.DisplayMessage("An Error has ocurred while trying to verify access to page. Please try again.", false); } }