-
Notifications
You must be signed in to change notification settings - Fork 1
Authorization #8
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Type
Fields
Give feedbackNo fields configured for issues without a type.
Based on top of a yet-to-be-created authentication layer, the REST APIs should support authorization: limiting certain methods to authenticated users and their roles
Basic idea
The
requireannotation makes the surrounding layer perform checks on the authenticated user. By annotating the containing class all its methods will be affected.@require(['admin'])- requires the user to be in the admin role@require(['admin', 'user'])- requires the user to be in the admin or user role@require(function($user) { ... })- runs a user-defined function on the user. Allows access if function returns true.