XF 2.0 I would like to extend this file XF\Permission\Builder

That would depend on your extension. It's completely impossible to say whether you can do something when you've not said anything about what you're trying to do.


Fillip
 
I want to change this function to retrieve the smallest value.

PHP:
public function pickPermissionPriorityValue(array $values, $permissionType)
    {
        if ($permissionType == 'integer')
        {
            $highest = 0;
            foreach ($values AS $value)
            {
                if ($value == -1)
                {
                    return -1;
                }
                else if ($value > $highest)
                {
                    $highest = $value;
                }
            }

            return $highest;
        }
        else
        {
            $priority = 5;
            $priorityName = 'unset';
            foreach ($values AS $value)
            {
                $thisPriority = $this->permissionPriority[$value];
                if ($thisPriority < $priority)
                {
                    $priority = $thisPriority;
                    $priorityName = $value;
                }
            }

            return $priorityName;
        }
    }
 
Back
Top Bottom