Returns all the permissions for a caller

@param \BeatSwitch\Lock\Callers\Caller $caller
@return \BeatSwitch\Lock\Permissions\Permission[]
170581
public function getCallerPermissions(Caller $caller)
    {
        $key = $this->getCallerKey($caller);

        return array_key_exists($key, $this->permissions) ? $this->permissions[$key] : [];
    }
119756
public function hasCallerPermission(Caller $caller, Permission $permission)
    {
        $query = $this->getTable()
            ->where('caller_type', $caller->getCallerType())
            ->where('caller_id', $caller->getCallerId())
            ->where('type', $permission->getType())
            ->where('action', $permission->getAction());

        if (is_null($permission->getResourceType())) {
            $query->whereNull('resource_type');
        } else {
            $query->where('resource_type', $permission->getResourceType());
        }

        if (is_null($permission->getResourceId())) {
            $query->whereNull('resource_id');
        } else {
            $query->where('resource_id', $permission->getResourceId());
        }

        return (bool) $query->first();
    }
92589
public function permissions()
    {
        return $this->belongsToMany(
            Config::get('laratrust.models.permission'),
            Config::get('laratrust.tables.permission_role'),
            Config::get('laratrust.foreign_keys.role'),
            Config::get('laratrust.foreign_keys.permission')
        );
    }
320217
public function getCurrentPermissionArray(ResourceNode $resourceNode)
    {
        $currentRoles = $this->tokenStorage->getToken()->getRoles();

        $roleNames = array_map(function (RoleInterface $roleName) {
            return $roleName->getRole();
        }, $currentRoles);

        $creatable = [];
        if ($this->isManager($resourceNode)) {
            /** @var ResourceType[] $resourceTypes */
            $resourceTypes = $this->om->getRepository('ClarolineCoreBundle:Resource\ResourceType')->findAll();

            foreach ($resourceTypes as $resourceType) {
                $creatable[] = $resourceType->getName();
            }

            $perms = array_fill_keys(array_values($this->maskManager->getPermissionMap($resourceNode->getResourceType())), true);
        } else {
            $creatable = $this->getCreatableTypes($roleNames, $resourceNode);

            $perms = $this->maskManager->decodeMask(
                $this->rightsRepo->findMaximumRights($roleNames, $resourceNode),
                $resourceNode->getResourceType()
            );
        }

        return array_merge($perms, ['create' => $creatable]);
    }
152725
public static function GetAndStoreUsersInSession($caller) {
        $users = array();
        if (!$caller->app()->user()->getAttribute(\Puzzlout\Framework\Enums\SessionKeys::AllUsers)) {
            $manager = $caller->managers()->getDalInstance($caller->module());
            $users = $manager->selectAllUsers();

            $caller->app()->user->setAttribute(
                    \Puzzlout\Framework\Enums\SessionKeys::AllUsers, $users
            );
        } else {
            $users = $caller->app()->user->getAttribute(\Puzzlout\Framework\Enums\SessionKeys::AllUsers);
        }
        return $users;
    }
454913
public function getPermissions()
    {
        $mode     = \RecursiveIteratorIterator::CHILD_FIRST;
        $iterator = $this->createRecursiveIterator($mode);

        $permissions = [];

        /** @var $child RoleInterface */
        foreach ($iterator as $child) {
            $permissions = array_replace_recursive($permissions, $child->getPermissions());
        }

        return array_replace_recursive($permissions, $this->permissions);
    }
182017
protected function getFreshAllPermissions()
    {
        $permissionsRoles = $this->getRolesPermissions(true);

        $permissions = app('defender.permission')->getActivesByUser($this);

        $permissions = $permissions->merge($permissionsRoles)
            ->map(function ($permission) {
                unset($permission->pivot, $permission->created_at, $permission->updated_at);

                return $permission;
            });

        return $permissions->toBase();
    }
92809
public function getPermissions()
    {
        if (!$this->permissions) {
            $permissions = new Permissions('Job/Permissions');
            if ($this->user) {
                $permissions->grant($this->user, Permissions::PERMISSION_ALL);
            }
            $this->setPermissions($permissions);
        }

        return $this->permissions;
    }
1126177
public function getPermissions($string) : array
    {
        $query = $this->getRepository()->createQueryBuilder('r')
            ->select('r')
            ->where('r.resource_class = :resourceClass AND r.resource_id=:resourceId')
            ->setParameter('resourceClass', 'string')
            ->setParameter('resourceId', $string)
            ->getQuery();

        return $query->getResult();
    }
460873
protected function getRoleAccessCallback()
    {
        return function ($key, $val, $index) {
            /** @var Token $sessionAuth */
            if (!$this->session->isStarted()) {
                return ['disabled' => 'disabled'];
            }
            $sessionAuth = $this->session->get('authentication');
            $currentUser = $sessionAuth->getUser();
            $allowedRoles = $this->permissions->getManipulatableRoles($currentUser->toArray());

            return in_array($key, $allowedRoles) ? [] : ['disabled' => 'disabled'];
        };
    }
907875
public function getUsers($permission, $object)
	{
		$permObject = $this->permission->findByPermissionAndObject($permission, $object);
		
		if(!$permObject)
			return array();
		
		return $this->userObjectPermission->findByObject($permObject, $object);
	}
478274
protected function getPermissionChecks($permissions, array $context, array $typeKeys): array
    {
        // Extra permission check of the whole tree to catch errors
        try {
            $this->lpProxy->checkAccess($permissions, $context, false);
        } catch (\Exception $e) {
            return [[
            'permissions' => $permissions,
            'resolve' => false,
            'error' => $e->getMessage(),
            ], ];
        }

        $checks = [];

        if (is_array($permissions)) {
            foreach ($permissions as $key => $value) {
                $checks = array_merge($checks, $this->getPermissionChecksRecursive([$key => $value], $context, $typeKeys));
            }
            if (count($permissions) > 1) {
                $checks[] = [
                'permissions' => $permissions,
                'resolve' => $this->lpProxy->checkAccess($permissions, $context, false),
                ];
            }
        } else {
            $checks = array_merge($checks, $this->getPermissionChecksRecursive($permissions, $context, $typeKeys));
        }

        return $checks;
    }
578111
public function getPermissions(Subject $subject, Resource $resource = null, array $params = [])
    {
        $permissions = [];

        foreach ($this->getPermissionsForSubject($subject) as $permissionName => $permission) {
            if ($resource === null && $permission->hasRules()) {
                continue;
            }

            if ($resource !== null && !$this->evaluatePermission($permission, $subject, $resource, $params)) {
                continue;
            }

            $permissions[] = $permissionName;
        }

        return $permissions;
    }
6713
public function permissions()
    {
        if (is_array($this->permissions)) {
            return $this->permissions;
        }

        if ($this->permissions) {
            return [ $this->permissions ];
        }

        return [];
    }
1119790
public function getPermissions()
    {
        if(!$this->permissions){
            $rolePermissions = $this->rolePermissions();
            $userPermissions = $this->grantedPermissions()->get();

            $permissions = $rolePermissions->merge($userPermissions);
            $deniedPermissions =$this->deniedPermissions()->get();

            $this->permissions = $permissions->filter(function($permission) use ($deniedPermissions)
            {
                return !$deniedPermissions->contains($permission);
            });
        }
        return $this->permissions;
    }
1027176
public static function allPermissionsFor($resource)
    {
        $result = [];
        foreach (static::$permissions as $permission) {
            $result[] = sprintf('%s %s', $permission, str_plural($resource));
        }

        return $result;
    }
304323
public function getPermissions()
    {
        $registry = $this->getService('application.registry');
        $key = $this->getIdentifier().'-permissions';

        if (!$registry->offsetExists($key)) {
            $registry->offsetSet($key, self::_getDefaultPermissions($this));
        }

        return $registry->offsetGet($key);
    }