src/Reflex/Lockdown/Users/Eloquent/User.php
public function has($permissions, $all = true)
    {
        if (! is_array($permissions)) {
            $permissions    =   (array) $permissions;
        }

        $permissions=   array_unique($permissions);
        $filtered   =   [];
        $usersRoles =   $this->roles;
        $allowed    =   false;
        $filtered   =   array_where($permissions, [$this, 'permissionFilter']);
        $filteredCount  =   count($filtered);

        // Does the permission lookup require all permissions to be found?
        if (true === $all) {
            return count($permissions) === $filteredCount;
        }

        // Nope, just as long as they have one of them
        return 0 < $filteredCount;
    }
public function has($permissions, $all = true)
    {
        if (! is_array($permissions)) {
            $permissions    =   (array) $permissions;
        }

        $permissions=   array_unique($permissions);
        $filtered   =   [];
        $usersRoles =   $this->roles;
        $allowed    =   false;
        $filtered   =   array_where($permissions, [$this, 'permissionFilter']);
        $filteredCount  =   count($filtered);

        // Does the permission lookup require all permissions to be found?
        if (true === $all) {
            return count($permissions) === $filteredCount;
        }

        // Nope, just as long as they have one of them
        return 0 < $filteredCount;
    }
public function has ( $ permissions , $ all = true ) { if ( ! is_array ( $ permissions ) ) { $ permissions = ( array ) $ permissions ; } $ permissions = array_unique ( $ permissions ) ; $ filtered = [ ] ; $ usersRoles = $ this -> roles ; $ allowed = false ; $ filtered = array_where ( $ permissions , [ $ this , 'permissionFilter' ] ) ; $ filteredCount = count ( $ filtered ) ; // Does the permission lookup require all permissions to be found? if ( true === $ all ) { return count ( $ permissions ) === $ filteredCount ; } // Nope, just as long as they have one of them return 0 < $ filteredCount ; }
Does the user have the permission?
@param  string|array $permissions Permission to lookup
@return boolean
Does the user have the permission?