private static bool HasViewAccessRight(ApplicationFroms form) { AccessRight right = new AccessRightService().GetSingle(new AccessRight { FormID = form.ToString(), UserID = CurrentUser.User.UserID }); return(right == null ? false : right.CanView.Value); }
private static bool HasViewAccessRight(ApplicationFroms form) { //if (form == null) return false; AccessRight right = new GenericService <AccessRight>().GetSingle(a => a.FormID == form.ToString() && a.UserID == CurrentUser.User.UserID && a.CanView.Value == true); return(right == null ? false : right.CanView.Value); }
public static bool HasViewAccess(ApplicationFroms form) { if (!HasViewAccessRight(form)) { Helper.ShowMessage("You dont have access right to view this form", "Access Control", MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } return(true); }
public static bool HasWriteAccess(ApplicationFroms form) { if (!HasEditAccessRight(form)) { Helper.ShowMessage("You dont have permission to make changes to this form", "Access Control", MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } return(true); }
void UpdateAccessRight(AccessRight rights, ApplicationFroms form) { _accessRightService.Update(rights); }
void UpdateAccessRight(AccessRight rights, ApplicationFroms form) { _accessRightService.Update(rights, r => r.UserID == _userID && r.FormID == form.ToString()); }