Check object existence and access, without throw Exception.

@param string $action
@param object $object

@return bool
161384
public function canAccessObject($action, $object)
    {
        return $object && $this->id($object) && $this->hasAccess($action, $object);
    }
1057918
public function setAction($action)
    {
        $result           = false;
        $actionsAvailable = $this->getActionsInfo();
        if (is_array($actionsAvailable) && array_key_exists($action,
                $actionsAvailable)) {
            $this->action = $action;
            $result       = true;
        }
        return $result;
    }
1288435
public function isActionAvailable($action)
    {
        $order = $this->getOrder();

        $availableActions = $this->getAvailableAction($order->getTransactionMode());

        $isAvailable = in_array($action, $availableActions);

        if ($isAvailable) {
            $isAvailable = false;

            switch ($action) {
                case 'capture':
                case 'reauthorize':
                case 'void':
                    if ($order->getRemainingOrderSum() > 0 && $order->getVoidedAmount() < $order->getRemainingOrderSum()) {
                        $isAvailable = true;
                    }
                    break;
            }
        }

        return $isAvailable;
    }
41382
public function isViewable($action = null)
    {
        if ($action === Action::IDENTIFIER) {
            return false;
        }

        return $this->isVisible($action);
    }
524940
protected function isViewGranted($object)
    {
        if ($object instanceof FieldVote) {
            $eventName = ObjectFilterEvents::OBJECT_FIELD_VIEW_GRANTED;
            $event = new ObjectFieldViewGrantedEvent($object);
            $permission = 'perm_read';
        } else {
            $eventName = ObjectFilterEvents::OBJECT_VIEW_GRANTED;
            $event = new ObjectViewGrantedEvent($object);
            $permission = 'perm_view';
        }

        $this->dispatcher->dispatch($eventName, $event);

        if ($event->isSkipAuthorizationChecker()) {
            return $event->isGranted();
        }

        return $this->ac->isGranted($permission, $object);
    }
998090
public function hasAction($action)
    {
        if ($action == 'index') {
            return true;
        }

        // Don't allow access to any non-public methods (inspect instance plus all extensions)
        $insts = array_merge([$this], (array) $this->getExtensionInstances());
        foreach ($insts as $inst) {
            if (!method_exists($inst, $action)) {
                continue;
            }
            $r = new ReflectionClass(get_class($inst));
            $m = $r->getMethod($action);
            if (!$m || !$m->isPublic()) {
                return false;
            }
        }

        $action  = strtolower($action);
        $actions = $this->allowedActions();

        // Check if the action is defined in the allowed actions of any ancestry class
        // as either a key or value. Note that if the action is numeric, then keys are not
        // searched for actions to prevent actual array keys being recognised as actions.
        if (is_array($actions)) {
            $isKey   = !is_numeric($action) && array_key_exists($action, $actions);
            $isValue = in_array($action, $actions, true);
            if ($isKey || $isValue) {
                return true;
            }
        }

        $actionsWithoutExtra = $this->config()->get('allowed_actions', true);
        if (!is_array($actions) || !$actionsWithoutExtra) {
            if (!in_array(strtolower($action), ['run', 'doinit']) && method_exists($this, $action)) {
                return true;
            }
        }

        return false;
    }
761621
private function methodCheck($class, string $action): bool
    {
        try {
            // If method not found in required class
            if (!\method_exists($class, $action)) {
                $className = \get_class($class);
                throw new Exception("Method \"$action\" is not found in \"$className\"");
            }
        } catch (Exception $e) {
            return false;
        }
        return true;
    }
1227219
public static function can($action, $object=null, $message=null)
    {
        if (!static::getAuthorizer()->can($action, $object)) {
            throw new Exception($message ?: self::DEFAULT_MSG , 112);
        }
        return true;
    }
205834
protected function checkAllScheduledByAction(array $objects, $action): void
    {
        foreach ($objects as $object) {
            if (!$this->getAuthorizationChecker()->isGranted('perm_'.$action, $object)) {
                throw new AccessDeniedException('Insufficient privilege to '.$action.' the entity');
            }
        }
    }
1111286
public function canExecute($action)
    {
        if (!$this->actor) {
            return false;
        }

        if (!$this->actor->isNotifiable()) {
            return false;
        }

        if ($this->actor->authorize('access') === false) {
            return false;
        }

        if ($this->actor->authorize('administration') === false) {
            return false;
        }

        return parent::canExecute($action);
    }
208205
public static function has_action( $path, $action = null ) 
	{
		$path = CCStr::cut( $path, '@' );
		$path = CCStr::cut( $path, '?' );
		
		// fix closure given
		if ( !is_string( $path ) )
		{
			return false;	
		}
		
		// get controllers default action
		if ( is_null( $action ) ) 
		{
			$action = static::$_default_action;
		}
		
		// try to load the controller
		if ( !$controller = static::create( $path ) ) 
		{
			return false;
		}
		
		return method_exists( $controller, static::$_action_prefix.$action );
	}
1225016
public function beforeAction($action)
    {
        if (in_array($action->controller->id, $this->controllers)) {
            throw new NotFoundHttpException('Not found');
        }

        return true;
    }
116827
public function is_object_exist($bucket, $object, $opt = array()) {
		$this->assertParameterArray ( $opt );
		$opt [self::BUCKET] = $bucket;
		$opt [self::METHOD] = 'HEAD';
		$opt [self::OBJECT] = $object;
		$response = $this->get_object_info ( $bucket, $object, $opt );
		if ($response->isOK ()) {
			return true;
		} elseif ($response->status === 404) {
			return false;
		}
		return $response;
	}
860381
protected function actionReferencesController($action)
    {
        if (! $action instanceof Closure) {
            return is_string($action) || (isset($action['uses']) && is_string($action['uses']));
        }

        return false;
    }
461739
public function exists(string $object) : bool
    {
        return (!empty($this->registry) && isset($this->registry[$object]));
    }
99569
public static function canAny($action, $objectType)
    {
        if (!isset($_SESSION['ACL_INFO'])) {
            return false;
        };
        $acl = $_SESSION['ACL_INFO'];
        foreach (array('*', $action) as $act) {
            if (array_key_exists($act, $acl)) {
                $acl2 = $acl[$act];
                foreach (array('*', $objectType) as $typ) {
                    if (array_key_exists($typ, $acl2)) {
                        foreach ($acl2[$typ] as $id) {
                            return true;
                        };
                    };
                };
            };
        };
        return false;
    }
210009
public function __isset($property)
	{
		if(!$this instanceof ArrayAccess)
			throw new Exception("Unable to perform this action on objects that are not children of ArrayAccess");
		
		return $this->offsetExists($property) && $this->offsetGet($property) !== null;
	}