oat-sa/tao-core

TAO core extension

Installs: 117 719

Dependents: 64

Suggesters: 0

Security: 0

Stars: 60

Watchers: 51

Forks: 35

Open Issues: 52

Type:tao-extension

v54.23.2 2024-11-14 14:23 UTC

This package is auto-updated.

Last update: 2024-11-15 14:09:27 UTC


README

codecov

Webhooks

Description

Webhooks allow you to send a request to remote server based on triggered event

How to use it

Register event webhook.

use command \oat\tao\scripts\tools\RegisterEventWebhook to register events that are implementing \oat\tao\model\webhooks\configEntity\WebhookInterface interface.

i.e:

$ php index.php 'oat\tao\scripts\tools\RegisterEventWebhook'
    \ -u "https://example.com"
    \ -m "POST"
    \ -e "<<Class FQN>>"

Check ACL Permissions

In order to check ACL permissions, you can use the PermissionChecker:

$permissionChecker = $this->getServiceLocator()->get(oat\tao\model\accessControl\PermissionChecker::class);

$permissionChecker->hasWriteAccess('resourceId');
$permissionChecker->hasReadAccess('resourceId');
$permissionChecker->hasGrantAccess('resourceId');

Important: It takes into consideration the current user in the session, if no user is provided.

Roles Access (rules and action permissions)

Description

Script allow you to apply (add)/revoke (remove) list of rules and/or permissions to a specific roles and actions.

How to use it

Execute the following command to apply (add) new rules/permissions:

$ php index.php 'oat\tao\scripts\tools\accessControl\SetRolesAccess' \
--config [config.json|json_string]

If you want to revoke (remove) them, add --revoke flag:

$ php index.php 'oat\tao\scripts\tools\accessControl\SetRolesAccess' \
--revoke \
--config [config.json|json_string]

Config example

{
  "rules": {
    "role": [
      {
        "ext": "extensionIdentifier",
        "mod": "actionControllerName",
        "act": "actionMethodName"
      }
    ]
  },
  "permissions": {
    "controller": {
      "action": {
        "rule1": "READ",
        "rule2": "WRITE"
      }
    }
  }
}

Environment variables

Here you can find the environment variables including feature flags

Routing

Check more information about actions/controllers and routing here

Observer implementations

Check the current observer implementations here