项目作者: oat-sa

项目描述 :
main extension of TAO
高级语言: PHP
项目地址: git://github.com/oat-sa/tao-core.git
创建时间: 2014-06-27T13:54:01Z
项目社区:https://github.com/oat-sa/tao-core

开源协议:GNU General Public License v2.0

下载


tao-core

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:

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

Check ACL Permissions

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

  1. $permissionChecker = $this->getServiceLocator()->get(oat\tao\model\accessControl\PermissionChecker::class);
  2. $permissionChecker->hasWriteAccess('resourceId');
  3. $permissionChecker->hasReadAccess('resourceId');
  4. $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:

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

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

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

Config example

  1. {
  2. "rules": {
  3. "role": [
  4. {
  5. "ext": "extensionIdentifier",
  6. "mod": "actionControllerName",
  7. "act": "actionMethodName"
  8. }
  9. ]
  10. },
  11. "permissions": {
  12. "controller": {
  13. "action": {
  14. "rule1": "READ",
  15. "rule2": "WRITE"
  16. }
  17. }
  18. }
  19. }

Environment variables

Here you can find the environment variables including feature flags

Variable Description Default value
FEATURE_FLAG_LISTS_DEPENDENCY_ENABLED Enable Remote Lists Dependency feature -
FEATURE_FLAG_ADVANCED_SEARCH_DISABLED Disable advanced search feature, if set to 1 -
FEATURE_FLAG_STATISTIC_METADATA_IMPORT Enable statistics metadata import -
FEATURE_FLAG_CKEDITOR_SOURCEDIALOG Enable source editing for ckeditor false
FEATURE_FLAG_SOLAR_DESIGN_ENABLED Activate the Solar Design mode -
GOOGLE_APPLICATION_CREDENTIALS Path to GCP credentials path -
DATA_STORE_STATISTIC_PUB_SUB_TOPIC Topic name for statistic metadata Pub/Sub -
REDIRECT_AFTER_LOGOUT_URL Allows to configure the redirect after logout via environment variable. The fallback is the configured redirect on urlroute.conf.php -
PORTAL_URL The Portal url used on the back button of Portal theme -
FEATURE_FLAG_TRANSLATION_ENABLED Enable access to items/tests translations feature -
TAO_ALLOWED_TRANSLATION_LOCALES Comma separated List of locales available for translations / authoring in the UI. If none provided, all are allowed -

Routing

Check more information about actions/controllers and routing here

Observer implementations

Check the current observer implementations here