User Group Permissions: Administrative

AndyB

Well-known member
Hello,

I would like to change the sorting of this template.

pic001.webp

The reason is that XenForo sets the Interface Group/Display Order between 1 and 205. So I have set my Group/Display Order add-ons all set to 300. This way they all fall after the default XenForo Permission Groups.

What I would like to do is add a secondary sort to the Model.

Could someone please point me to the correct Model that is used get the values which this template uses.

Thank you.
 
You might have to elaborate somewhat. For what purpose do you need a secondary sorting criteria?

Is the secondary criteria sorting an add-on in itself or part of some other add on you are releasing?
 
I would LOVE to be able to change the display sorting order of permissions. @AndyB when you develop this addon, I'd be happy to test it for you!! :D
 
You might have to elaborate somewhat. For what purpose do you need a secondary sorting criteria?

Is the secondary criteria sorting an add-on in itself or part of some other add on you are releasing?

Hi Chris,

When I want to change a User Group Permission for one of my add-ons, this is what I see:

(scrolled all way down to show there is no secondary sorting)

pic001.webp

Amazon should show before the other add-ons.
 
Got it.

library/XenForo/Model/Permission.php

Line 399 original code
PHP:
    /**
     * Gets all permission interface groups in order.
     *
     * @return array Format: [interface group id] => interface group info
     */
    public function getAllPermissionInterfaceGroups()
    {
        return $this->fetchAllKeyed('
            SELECT *
            FROM xf_permission_interface_group
            ORDER BY display_order
        ', 'interface_group_id');
    }

Line 399 modified code
PHP:
    /**
     * Gets all permission interface groups in order.
     *
     * @return array Format: [interface group id] => interface group info
     */
    public function getAllPermissionInterfaceGroups()
    {
        return $this->fetchAllKeyed('
            SELECT *
            FROM xf_permission_interface_group
            ORDER BY display_order, addon_id
        ', 'interface_group_id');
    }
 
@AndyB in ACP, Debug mode on > Dev tab > Permissions Definitions you can edit each permissions interface group and change the display order.

my question is, does this get overridden on an upgrade? Maybe a question for @Chris D.

My purpose is just wanting to sort the permissions to my liking. I'm assuming that "Display Order" is just that, and not a priority order of any kind. I know that sounds kind stupid but better to ask...just dabbling with debug mode
 
It is indeed harmless to change the display order, but pretty pointless as they will get reset.

If the permissions belong to an add-on, the display orders will be reset on upgrade (to the values defined by the add-on developer. If the permissions belong to XenForo, then the same happens when XF is upgraded (to the values defined by us).
 
Back
Top Bottom