protected function getFilteredPermissions()
    {
        $permissions = BackendAuth::listTabbedPermissions();

        if ($this->user->isSuperUser()) {
            return $permissions;
        }

        foreach ($permissions as $tab => $permissionsArray) {
            foreach ($permissionsArray as $index => $permission) {
                if (!$this->user->hasAccess($permission->code)) {
                    unset($permissionsArray[$index]);
                }
            }

            if (empty($permissionsArray)) {
                unset($permissions[$tab]);
            }
            else {
                $permissions[$tab] = $permissionsArray;
            }
        }

        return $permissions;
    }
protected function getFilteredPermissions()
    {
        $permissions = BackendAuth::listTabbedPermissions();

        if ($this->user->isSuperUser()) {
            return $permissions;
        }

        foreach ($permissions as $tab => $permissionsArray) {
            foreach ($permissionsArray as $index => $permission) {
                if (!$this->user->hasAccess($permission->code)) {
                    unset($permissionsArray[$index]);
                }
            }

            if (empty($permissionsArray)) {
                unset($permissions[$tab]);
            }
            else {
                $permissions[$tab] = $permissionsArray;
            }
        }

        return $permissions;
    }
protected function getFilteredPermissions ( ) { $ permissions = BackendAuth :: listTabbedPermissions ( ) ; if ( $ this -> user -> isSuperUser ( ) ) { return $ permissions ; } foreach ( $ permissions as $ tab => $ permissionsArray ) { foreach ( $ permissionsArray as $ index => $ permission ) { if ( ! $ this -> user -> hasAccess ( $ permission -> code ) ) { unset ( $ permissionsArray [ $ index ] ) ; } } if ( empty ( $ permissionsArray ) ) { unset ( $ permissions [ $ tab ] ) ; } else { $ permissions [ $ tab ] = $ permissionsArray ; } } return $ permissions ; }
Returns the available permissions; removing those that the logged-in user does not have access to

@return array The permissions that the logged-in user does have access to
Returns the available permissions ; removing those that the logged - in user does not have access to