Returns all routes which have require_permission option enabled

@return array
770478
private function getPermissionActions()
    {
        $actions = [];

        /**
         * @var $route \Symfony\Component\Routing\Route
         */
        foreach ($this->get('router')->getRouteCollection()->all() as $name => $route) {
            if ($route->hasOption('require_admin_permission')) {
                list(, $action) = explode('.', $route->getOption('require_admin_permission'));
                $actions[$action] = [
                    'id'   => $action,
                    'name' => $action
                ];
            }
        }

        ksort($actions);

        return array_values($actions);
    }
188370
private function getUsersPermissions()
    {
        return [
            [
                'name'        => 'Users - List all users',
                'description' => 'Allow to list all users.',
                'slug'        => UsersPolicy::PERMISSION_LIST,
            ],
            [
                'name'        => 'Users - View a user',
                'description' => 'Allow to view a user\'s details.',
                'slug'        => UsersPolicy::PERMISSION_SHOW,
            ],
            [
                'name'        => 'Users - Add/Create a user',
                'description' => 'Allow to create a new user.',
                'slug'        => UsersPolicy::PERMISSION_CREATE,
            ],
            [
                'name'        => 'Users - Edit/Update a user',
                'description' => 'Allow to update a user.',
                'slug'        => UsersPolicy::PERMISSION_UPDATE,
            ],
            [
                'name'        => 'Users - Delete a user',
                'description' => 'Allow to delete a user.',
                'slug'        => UsersPolicy::PERMISSION_DELETE,
            ],
        ];
    }
742358
public function getAuthRoutes()
    {
        $menu = $this->getMenu();
         
        if (!$menu) {
            return $this->extendPermissionRoutes();
        }
        
        return ArrayHelper::merge($this->extendPermissionRoutes(), $menu->getPermissionRoutes());
    }
491188
public function getPermission()
    {
        $this->request->allowMethod(['ajax']);

        $group_or_user = isset($this->request->data['group_or_user']) ? $this->request->data['group_or_user'] : null;
        $group_or_user_id = isset($this->request->data['group_or_user_id']) ? $this->request->data['group_or_user_id'] : null;

        $ugp = $this->UserGroupPermission->find()
            ->select(['permission_id','allow'])
            ->where(
                [
                    'group_or_user_id' => $group_or_user_id,
                    'group_or_user' => $group_or_user
                ])->toArray();

        $response = (!empty($ugp) && !is_null($ugp)) ? $ugp : 'fail';

        $this->set(compact('response'));
        $this->set('_serialize', ['response']);
        $this->render('Acl.Ajax/ajax_response', false);
    }
686933
public static function get_declared_permissions_list()
    {
        if (!self::$declared_permissions) {
            return null;
        }

        if (self::$declared_permissions_list) {
            return self::$declared_permissions_list;
        }

        self::$declared_permissions_list = array();

        self::traverse_declared_permissions(self::$declared_permissions, self::$declared_permissions_list);

        return self::$declared_permissions_list;
    }
912581
public function getAllPermissions(): Collection
    {
        $user = auth()->user();

        if ($user->hasRole($this->roleRepository::ROLE_PA)) {
            $permissions = $this->permissionRepository->makeQuery()
                ->select('id', 'name', 'action', 'created_at')
                ->where('name', '!=', 'admin.acl.role')
                ->get();
        } elseif ($user->isSuperAdmin()) {
            $permissions = $this->permissionRepository->makeQuery()
                ->select('id', 'name', 'action', 'created_at')->get();
        } else {
            $permissions = collect([]);
        }

        return $permissions->sortBy('name')->groupBy('name');
    }
681714
protected function getSyncMapPermissions() {
        if (!$this->_syncMapPermissions) {
            $this->_syncMapPermissions = new SyncMapPermissionList(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->_syncMapPermissions;
    }
739123
public function allPermissions() : Collection
    {
        return $this->roles()->with('permissions')->get()->pluck('permissions')->flatten()->merge($this->permissions);
    }
386962
public function getRoutes()
    {
        $manager = Yii::$app->getAuthManager();
        $routes = $this->getAppRoutes();
        $exists = [];
        foreach (array_keys($manager->getPermissions()) as $name) {
            if ($name[0] !== '/') {
                continue;
            }
            $exists[] = $name;
            unset($routes[$name]);
        }
        return [
            'avaliable' => array_keys($routes),
            'assigned' => $exists
        ];
    }
243034
public function setApplicationPermissions()
    {
        $files = (array) $this->config->getContextually('remote.permissions.files');
        foreach ($files as &$file) {
            $this->modulable->setPermissions($file);
        }

        return true;
    }
1370082
protected function getAllPermissions() {
    $permissions = &drupal_static(__FUNCTION__);

    if (!isset($permissions)) {
      $permissions = \Drupal::service('user.permissions')->getPermissions();
    }

    return $permissions;
  }
682984
public function providePermissions()
    {
        $permissions = [];
        foreach (MenuSet::get() as $menuset) {
            $key = $menuset->PermissionKey();
            $permissions[$key] = [
                'name' => _t(
                    __CLASS__ . '.EDITMENUSET',
                    "Manage links with in '{name}'",
                    [
                        'name' => $menuset->obj('Title')
                    ]
                ),
                'category' => _t(__CLASS__ . '.MENUSETS', 'Menu sets')
            ];
        }
        return $permissions;
    }
460133
public static function permissions(): array
    {
        $aPermissions = parent::permissions();

        $aPermissions['object:browse']  = 'Can browse existing objects';
        $aPermissions['object:create']  = 'Can create new objects';
        $aPermissions['object:delete']  = 'Can delete existing objects';
        $aPermissions['object:restore'] = 'Can restore deleted objects';
        $aPermissions['object:purge']   = 'Can purge deleted objects';
        $aPermissions['bucket:create']  = 'Can create new buckets';

        return $aPermissions;
    }
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);
    }
1056809
public function getPermissions()
    {
        $permissions = &gplcart_static('user.role.permissions');

        if (isset($permissions)) {
            return $permissions;
        }

        $permissions = (array) gplcart_config_get(GC_FILE_CONFIG_PERMISSION);
        asort($permissions);

        $this->hook->attach('user.role.permissions', $permissions, $this);
        return $permissions;
    }
272210
public function getPermissionsIdList() {

		$permissions		= $this->permissionMappingList;
		$permissionsList	= [];

		foreach ( $permissions as $permission ) {

			array_push( $permissionsList, $permission->permissionId );
		}

		return $permissionsList;
	}
438395
public function allPermissions()
    {
        $roles = $this->roles()->with('permissions')->get();

        $roles = $roles->flatMap(function ($role) {
            return $role->permissions;
        });

        return $this->permissions()->get()->merge($roles)->unique('name');
    }