public interface PermissionAPI
Modifier and Type | Method and Description |
---|---|
boolean |
checkAPICallWithScript(String className,
APICallContext apiCallContext,
boolean reload)
Execute a groovy class, identified by it's class name, stored either in the classpath for default provided scripts, or in database for custom scripts.
|
boolean checkAPICallWithScript(String className, APICallContext apiCallContext, boolean reload) throws ExecutionException, NotFoundException
PermissionRule
and execute it using its
fully qualified class name.
The class MUST implements PermissionRule
.
The class must implement method isAllowed() that returns TRUE to authorize access, or FALSE to forbid access.
If the script throws exception, it is up to the calling application to decide if the access should be granted or not.
To store your custom class in database, you must use the Setup Tool. Your custom groovy script must be placed in folder platform_conf/current/tenants/<tenant id>/tenant_security_scripts/. For more information on using the setup tool, refer to the Platform setup tool documentation page
className
- the name of the class of the ruleapiCallContext
- the context of the api callreload
- reload class when calling this method, warning if some class were called with reload set to false, they will never be reloadableExecutionException
- If there is an exception while executing the scriptNotFoundException
- if the script cannot be found under name classNameneither in the classpath, nor in the custom script folder.
Copyright © 2018 Bonitasoft S.A.. All rights reserved.