original_string: public function checkAuthorisation($object, $functionName)
      {
          // Check whether the user has authenticated.
          if ($this->isAuthenticated()) {
              // The user is authenticated. Proceed.
              $class = $object;
              if (is_object($class)) {
                  $class = get_class($class);
              }
  
           Logger::get()->debug("Checking authorisation for {$class}:{$functionName}...");
  
              // Check that at least one condition is valid.
              if (!(
                  // User has total authorisation.
                  in_array('*', $this->permissions)
                  // User has total class authorisation for this class.
                  || @$this->permissions[$class]['*']
                  // User has authorisation for this function in this class.
                  || @$this->permissions[$class][$functionName]
              )) {
                  // User has no authorisation.
                  throw new NotAuthorisedException("The current user does not have permission for '{$class}.{$functionName}'.");
              }
  
           Logger::get()->debug('Authorised.');
          } else {
              // The user is not authenticated.
              throw new NotAuthenticatedException('There is no current authenticated user.');
          }
      }
code: public function checkAuthorisation($object, $functionName)
      {
          // Check whether the user has authenticated.
          if ($this->isAuthenticated()) {
              // The user is authenticated. Proceed.
              $class = $object;
              if (is_object($class)) {
                  $class = get_class($class);
              }
  
           Logger::get()->debug("Checking authorisation for {$class}:{$functionName}...");
  
              // Check that at least one condition is valid.
              if (!(
                  // User has total authorisation.
                  in_array('*', $this->permissions)
                  // User has total class authorisation for this class.
                  || @$this->permissions[$class]['*']
                  // User has authorisation for this function in this class.
                  || @$this->permissions[$class][$functionName]
              )) {
                  // User has no authorisation.
                  throw new NotAuthorisedException("The current user does not have permission for '{$class}.{$functionName}'.");
              }
  
           Logger::get()->debug('Authorised.');
          } else {
              // The user is not authenticated.
              throw new NotAuthenticatedException('There is no current authenticated user.');
          }
      }
code_tokens: public function checkAuthorisation ( $ object , $ functionName ) { // Check whether the user has authenticated. if ( $ this -> isAuthenticated ( ) ) { // The user is authenticated. Proceed. $ class = $ object ; if ( is_object ( $ class ) ) { $ class = get_class ( $ class ) ; } Logger :: get ( ) -> debug ( "Checking authorisation for {$class}:{$functionName}..." ) ; // Check that at least one condition is valid. if ( ! ( // User has total authorisation. in_array ( '*' , $ this -> permissions ) // User has total class authorisation for this class. || @ $ this -> permissions [ $ class ] [ '*' ] // User has authorisation for this function in this class. || @ $ this -> permissions [ $ class ] [ $ functionName ] ) ) { // User has no authorisation. throw new NotAuthorisedException ( "The current user does not have permission for '{$class}.{$functionName}'." ) ; } Logger :: get ( ) -> debug ( 'Authorised.' ) ; } else { // The user is not authenticated. throw new NotAuthenticatedException ( 'There is no current authenticated user.' ) ; } }
docstring: Checks whether a user is allowed to execute a particular function in a
  class.
  
  @param  mixed                  $object       the object or class name that contains the function.
  @param  type                   $functionName the function name to execute.
  @throws NotAuthorisedException
docstring_tokens: Checks whether a user is allowed to execute a particular function in a class .