示例#1
0
        public static CompiledSecurityInfo CompileAccessLevel(DatabaseManager manager, IPrincipal user)
        {
            if (user != null && user.Identity != null && user.Identity.Name != String.Empty)
            {
                CompiledSecurityInfo level = new CompiledSecurityInfo();

                level.AddPermissions(SecurityInfo.FromDatabase(manager, user.Identity.Name));

                foreach (string group in Roles.GetRolesForUser())
                {
                    level.AddPermissions(SecurityInfo.FromDatabase(manager, group));
                }

                return level;
            }
            else
            {
                return new CompiledSecurityInfo();
            }
        }
示例#2
0
        public static void PopulateClubTable(DatabaseManager manager, UserProfile settings, CompiledSecurityInfo level, HtmlTable table, int offset, int rows, Dictionary<int, CheckBox> checkBoxes)
        {
            string mode;

            if (level["CanApproveClub"] && level["CanViewAllClub"])
                mode = "Approval";
            else if (level["CanViewAllClub"])
                mode = "ViewAll";
            else
                mode = "Submission";

            PopulateClubTable(manager, settings, mode, false, table, offset, rows, checkBoxes);
        }