Last active
February 12, 2016 15:32
-
-
Save innerdaze/3cf7a5b82fb88b006e97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
method process | |
proc | |
begin | |
data lAction, string, Parameter('action') | |
data lAllowed, boolean, false | |
if (lAction == 'GET') | |
begin | |
; Boss | |
lAllowed = Role.resolveRole('boss', Session.context) | |
; SalesManager | |
lAllowed = Role.resolveRole('salesManager', Session.context) | |
; Salesman | |
lAllowed = Role.resolveRole('sales', Session.context) | |
if (!lAllowed) | |
throw new NotAllowedError() ; or whatever we have | |
else | |
.. return data | |
else if (lAction == 'POST') | |
begin | |
; Boss | |
lAllowed = Role.resolveRole('boss', Session.context) | |
if (!lAllowed) | |
throw new NotAllowedError() ; or whatever we have | |
else | |
.. write data | |
end | |
end | |
endmethod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment