original_string: protected function _canAccess($object) {
          if(!is_object($object)) {
              $object=singleton($object);
          }
          
          //Ensure the object is an instance of CodeBank_APIClass
          if(!($object instanceof CodeBank_APIClass)) {
              //If in dev mode and object is an instance of ZendAmfServiceBrowser return true
              if(Director::isDev() && $object instanceof ZendAmfServiceBrowser) {
                  return true;
              }
              
              return false;
          }
          
          
          //Fetch permissions from the object
          $perms=$object->getRequiredPermissions();
          
          //Check to see if the permissions are not empty
          if(!empty($perms) && $perms!==false) {
              //Ensure we have an array, if not throw an exception
              if(!is_array($perms)) {
                  throw new Zend_Amf_Exception('CodeBank_APIClass::getRequiredPermissions() Should return an array of permissions to check');
                  return false;
              }
              
              //Loop through and ensure the user has the required permissions return false if they are missing any
              foreach($perms as $permission) {
                  if(!Permission::check($permission)) {
                      return false;
                  }
              }
          }
          
          return true;
      }
code: protected function _canAccess($object) {
          if(!is_object($object)) {
              $object=singleton($object);
          }
          
          //Ensure the object is an instance of CodeBank_APIClass
          if(!($object instanceof CodeBank_APIClass)) {
              //If in dev mode and object is an instance of ZendAmfServiceBrowser return true
              if(Director::isDev() && $object instanceof ZendAmfServiceBrowser) {
                  return true;
              }
              
              return false;
          }
          
          
          //Fetch permissions from the object
          $perms=$object->getRequiredPermissions();
          
          //Check to see if the permissions are not empty
          if(!empty($perms) && $perms!==false) {
              //Ensure we have an array, if not throw an exception
              if(!is_array($perms)) {
                  throw new Zend_Amf_Exception('CodeBank_APIClass::getRequiredPermissions() Should return an array of permissions to check');
                  return false;
              }
              
              //Loop through and ensure the user has the required permissions return false if they are missing any
              foreach($perms as $permission) {
                  if(!Permission::check($permission)) {
                      return false;
                  }
              }
          }
          
          return true;
      }
code_tokens: protected function _canAccess ( $ object ) { if ( ! is_object ( $ object ) ) { $ object = singleton ( $ object ) ; } //Ensure the object is an instance of CodeBank_APIClass if ( ! ( $ object instanceof CodeBank_APIClass ) ) { //If in dev mode and object is an instance of ZendAmfServiceBrowser return true if ( Director :: isDev ( ) && $ object instanceof ZendAmfServiceBrowser ) { return true ; } return false ; } //Fetch permissions from the object $ perms = $ object -> getRequiredPermissions ( ) ; //Check to see if the permissions are not empty if ( ! empty ( $ perms ) && $ perms !== false ) { //Ensure we have an array, if not throw an exception if ( ! is_array ( $ perms ) ) { throw new Zend_Amf_Exception ( 'CodeBank_APIClass::getRequiredPermissions() Should return an array of permissions to check' ) ; return false ; } //Loop through and ensure the user has the required permissions return false if they are missing any foreach ( $ perms as $ permission ) { if ( ! Permission :: check ( $ permission ) ) { return false ; } } } return true ; }
docstring: Checks to see if the member can access the requested class
  @param {string|CodeBank_APIClass} $object Name of the class to check or an instance of CodeBank_APIClass
docstring_tokens: Checks to see if the member can access the requested class