Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 1.34 KB

File metadata and controls

41 lines (27 loc) · 1.34 KB
code type title description
true
page
checkRights
Checks if an API action can be executed by the current user

checkRights

Checks if the provided API request can be executed by the current logged user.


checkRights(requestPayload)
Property Type Description
requestPayload
object
Contains a RequestPayload
timeout
number
Time (in ms) during which a request will still be waited to be resolved. Set it -1 if you want to wait indefinitely

requestPayload

The RequestPayload must contains at least the following properties:

  • controller: API controller
  • action: API action

Resolves

A boolean telling whether the provided request would have been allowed or not.

Usage

<<< ./snippets/check-rights.js