コード例 #1
0
ファイル: SecurityRolesCore.cs プロジェクト: cmcd74/SavvyCMS
        // do not add site-custom roles here - instead, add them in Site.SiteCustom.SecurityRoles

        public static Forms.SelectOptions GetRoleDropDownOptions()
        {
            var options = new Forms.SelectOptions();

            options.Add(Roles.ADMINISTRATOR, "Administrator");
            if (Security.IsSuperAdminAccess)
            {
                options.Add(Roles.ADMINISTRATOR + "," + Roles.SUPERADMIN, "SuperAdmin");
            }
            if (Security.IsDevAccess)
            {
                options.Add(Roles.ADMINISTRATOR + "," + Roles.SUPERADMIN + "," + Roles.DEVELOPER, "Developer");
            }
            // do not add site-custom roles here - instead, add them in Site.SiteCustom.SecurityRoles
            return(options);
        }
コード例 #2
0
        // note: the method we use above is not compatible with Authorise Attributes. If you use them, you may be better to use const instead (as example below), as this is accessable from within authorise attribute - it depends if you are using Authorise Attributes or not
        //public const string OnlineCatalogUser = "******";

        public new static Forms.SelectOptions GetRoleDropDownOptions()
        {
            var options = new Forms.SelectOptions();

            // TODO - add any custom roles here
            // some role options should include multiple roles, eg Teacher might also include Administator, whereas Student might not
            //options.Add(Roles.ADMINISTRATOR + "," + Roles.TEACHER, "Teacher");
            //options.Add(Roles.STUDENT, "Student");
#if PageRevisions
            if (Settings.All.EnableWorkflow)
            {
                options.Add(Roles.EDITOR, "Editor");
            }
#endif
            //options.Add(Roles.ADMINISTRATOR + "," + Roles.APPROVALSSUPERADMINISTRATOR, "Approvals Super Administrator");
            options.Add(SecurityRolesCore.GetRoleDropDownOptions());
            return(options);
        }