Пример #1
0
        private void RefreshPermissions()
        {
            permissionSet = new PermissionSet();

            var permittedList = CloudCoreDB.Context.Cloudcore_VwPermittedSystemActions.Where(psa => psa.UserId == CloudCoreIdentity.UserId)
                .Select(r => r.ActionGuid).ToList();

            permissionSet.Permissions.AddRange(permittedList);

            AddAdminPermissions();

            permissionSet.LastUpdated = LastUpdated;

            SessionInfo.Session["CC_ACL"] = permissionSet;
        }
Пример #2
0
        public UserPermission()
        {
            var acl = SessionInfo.Session["CC_ACL"] as PermissionSet;
            if (acl == null)
            {
                RefreshPermissions();
            }
            else
            {
                permissionSet = acl;

                if (permissionSet.LastUpdated == LastUpdated)
                    return;

                RefreshPermissions();
                MenuData.ForceRefresh();
            }
        }