php - Get name of a repository var in Symfony -


i have function checks if user has access repository.

public function getacl($repository, $granted){      if (false === $this->authorizationchecker->isgranted($granted, $repository)) {          $this->get('log')->writelog('access denied.', __line__, 3);         return new jsonresponse(array(             'result' => 'error',             'message' => 'not allowed'         ));     }      return true; } 

the call

/* client */ $client = $em->getrepository('appbundle:client')->find($request->get('clientid'));  /* acl */ $this->get('global_functions')->getacl($client, 'view'); 

what i'd get

i see name of repository user has been denied to, this:

$this->get('log')->writelog('access denied $repositoryname.', __line__, 3); 

in case $repositoryname should appbundle:client or client

is @ possible? there way t

may so

$this->get('log')->writelog('access denied '.get_class($repository).'.', __line__, 3); 

or

$class = get_class($repository); $this->get('log')->writelog('access denied '.substr($class, strrpos($class, '\\') + 1).'.', __line__, 3); 

or didn't understand question


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -