How to prevent select user groups from reordering structures I need to create a plugin that prevents select user groups from reordering a Structure content type in the Entries listing. I could quickly do this by just hiding the a.move.icon element, but I worry about the longevity of this solution. For example, if this class were to change then the plugin wouldn't hide the element any longer.

Is there a better, more long-term fix that someone might recommend here?
You should be able to ensure that the elements aren't moved by using the structures.onBeforeMoveElement hook in a plugin:

public function init()
{
    craft()-&gt;on('structures.beforeMoveElement', function(Event $event)
    {
        $user = craft()-&gt;userSession-&gt;getUser();

        if (!$user-&gt;isInGroup('allowedGroup'))
        {
            $event-&gt;performAction = false;
        }
    });
}


I've had a quick look through the source but I'm not 100% sure if this is also run when an element's parent is changed. I would think it is.



You could also create your own custom user permission that can be assigned to individual users or multiple groups for more flexibility:

public function init()
{
    craft()-&gt;on('structures.beforeMoveElement', function(Event $event)
    {
        $user = craft()-&gt;userSession-&gt;getUser();

        if (!$user-&gt;can('pluginName-moveElements'))
        {
            $event-&gt;performAction = false;
        }
    });
}

public function registerUserPermissions()
{
    return array(
        'pluginName-moveElements' =&gt; array('label' =&gt; Craft::t('Move Elements in Structures')),
    );
 }