예제 #1
0
        private void BindRoles()
        {
            ddlRoles.Items.Clear();

            ddlRoles.Items.Add(new ListItem("[All Users]", "-1"));
            ddlRoles.Items.Add(new ListItem("[All Authenticated Users]", "-2"));
            ddlRoles.Items.Add(new ListItem("[All Un-Authenticated Users]", "-3"));

            foreach (var role in Role.AllRoles())
            {
                ddlRoles.Items.Add(new ListItem(role.Name, role.Id.ToString()));
            }
        }
예제 #2
0
        /// <summary>
        /// Binds the roles.
        /// </summary>
        private void BindRoles()
        {
            ddlRoles.Items.Clear();

            ddlRoles.Items.Add(new ListItem("[All Users]", "-1"));
            ddlRoles.Items.Add(new ListItem("[All Authenticated Users]", "-2"));
            ddlRoles.Items.Add(new ListItem("[All Un-Authenticated Users]", "-3"));

            var securityRoleType = GroupTypeCache.Read(Rock.SystemGuid.GroupType.GROUPTYPE_SECURITY_ROLE.AsGuid());

            foreach (var role in Role.AllRoles())
            {
                string name = role.IsSecurityTypeGroup ? role.Name : "GROUP - " + role.Name;
                ddlRoles.Items.Add(new ListItem(name, role.Id.ToString()));
            }
        }