Returns all permissions known by the authenticator.

@todo This should be cached

@return string[]
12876
public function getAllPermissions()
    {
        $permissions = [];

        // Gather and combine all permissions for roles
        foreach ($this->roleModel->all() as $role) {
            $permissions = array_merge(
                $permissions,
                array_keys(array_filter($role->getPermissions()))
            );
        }

        // Gather permissions set specifically for users
        foreach ($this->userModel->all() as $user) {
            $permissions = array_merge(
                $permissions,
                array_keys(array_filter($user->getPermissions()))
            );
        }

        sort($permissions);

        return array_unique($permissions);
    }
170581
public function getCallerPermissions(Caller $caller)
    {
        $key = $this->getCallerKey($caller);

        return array_key_exists($key, $this->permissions) ? $this->permissions[$key] : [];
    }
555429
public function getAllPermissions(): Collection
    {
        $permissions = $this->permissions;

        if ($this->roles) {
            $permissions = $permissions->merge($this->getPermissionsViaRoles());
        }

        return $permissions->sort()->values();
    }
523445
public function getPermissions() {
		$permissions = [];
		foreach ($this->role->sharedPermissionList as $permission) {
			$permissions[] = $permission->name;
		}

		return $permissions;
	}
541235
protected function getAclUsers()
    {
        $aclUsers = [];

        $userManagerServiceName = $this->container->getParameter('sonata.admin.security.acl_user_manager');
        if (null !== $userManagerServiceName && $this->has($userManagerServiceName)) {
            $userManager = $this->get($userManagerServiceName);

            if (method_exists($userManager, 'findUsers')) {
                $aclUsers = $userManager->findUsers();
            }
        }

        return \is_array($aclUsers) ? new \ArrayIterator($aclUsers) : $aclUsers;
    }
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);
    }
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);
    }
643267
public function getAuthorisedGroups()
	{
		if (is_null($this->authGroups))
		{
			$this->authGroups = array();
		}

		if (empty($this->authGroups))
		{
			$this->authGroups = Access::getGroupsByUser($this->get('id'));
		}

		return $this->authGroups;
	}
1354215
protected function getUserRoles()
    {
        if (!$this->auth->guest()) {
            return $this->auth->roles();
        }


        return $this->roles->has('guest') ? ['guest'] : [];
    }
149459
public function getPermissionActions()
    {
        $actions = [];

        /**
         * @var $route \Symfony\Component\Routing\Route
         */
        foreach ($this->router->getRouteCollection()->all() as $name => $route) {
            if ($route->hasOption('require_admin_permission')) {
                $options = explode('.', $route->getOption('require_admin_permission'));
                if (!array_key_exists($options[0], $actions))
                    $actions[$options[0]] = [];
                if (!in_array($options[1], $actions[$options[0]]))
                    $actions[$options[0]][] = $options[1];
            }
        }

        ksort($actions);

        return $actions;
    }
1372584
public function getPermissions()
    {
        $permissions = [[], []];

        foreach ($this->roles as $role) {
            $permissions[] = $role->getPermissions();
        }

        return call_user_func_array('array_merge', $permissions);
    }
1121654
protected function _getGroupPermissions()
    {
        if (get_class($this->GroupPermissions) === 'GroupPermission') {
            return $this->GroupPermissions;
        }
        return $this->GroupPermissions = TableRegistry::get('Wasabi/Core.GroupPermissions');
    }
151641
public function getRolesWithPermissions(): Collection
    {
        return $this->roleRepository->makeQuery()
            ->with('permissions')
            ->notSuperAdmin()
            ->orderBy('name')
            ->get()
            ->map(function (HCAclRole $role) {
                return [
                    'id' => $role->id,
                    'role' => $role->name,
                    'slug' => $role->slug,
                    'permissions' => $role->permissions->pluck('id')->all(),
                ];
            });
    }
1362507
public function getRules()
    {
        $perm = $this->permissions;
        $data = array();

        foreach ($perm as $val)
        {
            list($prefix,$data[]) = explode('.', $val);
        }

        return implode(',',$data);
    }
110959
protected function getAuthenticationProviders()
    {
        $providerNames = array_keys($this->authenticationManager->getProviders());
        sort($providerNames);
        return array_combine($providerNames, $providerNames);
    }
542304
public function getPermissions()
    {
        // user permissions overridden from role.
        $permissions = \Cache::remember(
            'acl.getPermissionsById_'.$this->id,
            config('acl.cacheMinutes'),
            function () {
                return $this->getPermissionsInherited();
            }
        );

        // permissions based on role.
        // more permissive permission wins
        // if user has multiple roles we keep
        // true values.
        foreach ($this->roles as $role) {
            foreach ($role->getPermissions() as $slug => $array) {
                if ( array_key_exists($slug, $permissions) ) {
                    foreach ($array as $clearance => $value) {
                        if( !array_key_exists( $clearance, $permissions[$slug] ) ) {
                            ! $value ?: $permissions[$slug][$clearance] = true;
                        }
                    }
                } else {
                    $permissions = array_merge($permissions, [$slug => $array]);
                }
            }
        }

        return $permissions;
    }
302112
public function permissions()
    {
        if ( ! isset($this->permissions) ) {
            $permissionModel = $this::$permissionModel;

            $this->permissions = $permissionModel::whereHas('roles', function ($query) {
                $query->whereHas('users', function ($query) {
                    $query->where('id', $this->id);
                });
            })->get();
        }

        return $this->permissions;
    }