private PermissionsControlType BindDataList()
    {
        PermissionsControlType type;

        ControlType = ControlType.ToLowerInvariant();
        if (ControlType.Contains("group"))
        {
            GroupList allGroups = _permissionsManager.GetUsersGroups(Context.User.Identity.Name);
            Func <GroupList, List <UserGroup> > filterFunc;
            if (ControlType == "defaultgroup")
            {
                filterFunc = GetDefaultGroups;
                type       = PermissionsControlType.DEFAULT_GROUP;
            }
            else
            {
                filterFunc = GetExistingNonDefaultGroups;
                type       = PermissionsControlType.GROUP;
            }

            PermissionsListView.DataSource =
                GetPermissionLevelsForGroups(filterFunc(allGroups));
        }
        else if (ControlType.Contains("user"))
        {
            PermissionsListView.DataSource = GetPermissionLevelsForUsers();
            type = PermissionsControlType.USER;
        }
        else
        {
            throw new Exception("Invalid ControlType specified");
        }

        PermissionsListView.DataBind();

        return(type);
    }