original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Returns the available permissions ; removing those that the logged - in user does not have access to