/** * Check if the given User has permission to do action on this objects assigned model * * @param CanInterface $object * @param string $action * @return bool */ function checkPermission(CanInterface $object, $action) { $permission = false; if (in_array($action, Config::get('auth::user_actions', []))) { $permission = $this->getEntity()->getId() == $object->getId(); } return $permission; }