code: public function isAuthorized(string $resource): bool
      {
          // get permission model object
          if (null === $permission = (PermissionsEntityMapper::getInstance())->getObjectByTitle($resource, true)) {
              throw new Exceptions\QueryResultsNotFoundException("Permission not found for: $resource");
          }
  
          // authorized if administrator has at least one role assigned to permission 
          return $this->getLoggedInAdministrator()->hasOneRoleByObject($permission->getRoles());
      }
docs: $resource matches permission.title