https://github.com/oat-sa/tao-core
main extension of TAO
https://github.com/oat-sa/tao-core
assessment
Last synced: 6 months ago
JSON representation
main extension of TAO
- Host: GitHub
- URL: https://github.com/oat-sa/tao-core
- Owner: oat-sa
- License: gpl-2.0
- Created: 2014-06-27T13:54:01.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-04-12T15:40:58.000Z (over 1 year ago)
- Last Synced: 2024-04-14T09:44:42.447Z (over 1 year ago)
- Topics: assessment
- Language: PHP
- Homepage: http://www.taotesting.com
- Size: 259 MB
- Stars: 57
- Watchers: 54
- Forks: 31
- Open Issues: 63
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tao-core
[](https://codecov.io/gh/oat-sa/tao-core)
- [Task Queue Doc](models/classes/taskQueue/README.md)
- [Middlewares Doc](models/classes/Middleware/README.md)
- [Feature Flag](models/classes/featureFlag/README.md)
- [CSRF Tokens](models/classes/security/xsrf/README.md)
- [Client Config](models/classes/clientConfig/README.md)# 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 "<>"
```# Check ACL Permissions
In order to check ACL permissions, you can use the `PermissionChecker`:
```php
$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
```json
{
"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
| 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](./models/classes/routing/README.md)
# Observer implementations
Check the current [observer implementations here](./models/classes/Observer/README.md)