Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
 void UpdateAccessRight(AccessRight rights, ApplicationFroms form)
 {
     _accessRightService.Update(rights);
 }
Пример #6
0
 void UpdateAccessRight(AccessRight rights, ApplicationFroms form)
 {
     _accessRightService.Update(rights, r => r.UserID == _userID && r.FormID == form.ToString());
 }