コード例 #1
0
        public virtual void BeforeCreate(int ParentID)
        {
            AbstractPage Parent = LS.CurrentEntityContext.AbstractPages.FirstOrDefault(r => r.ID == ParentID);

            if (Parent == null)
            {
                List <string> GetRoleListView = SF.GetRoleList();
                List <string> GetRoleListEdit = SF.GetRoleList();
                GetRoleListView.Remove("Admin");
                GetRoleListEdit.Remove("Admin");
                GetRoleListEdit.Remove("Anonymous");
                this.PermissionsView = SF.RolesListToString(GetRoleListView);
                this.PermissionsEdit = SF.RolesListToString(GetRoleListEdit);
            }
            else
            {
                this.PermissionsView = Parent.PermissionsView;
                this.PermissionsEdit = Parent.PermissionsEdit;
            }
        }