Skip to content

Commit

Permalink
Merge pull request #4262 from AnuradhaSK/update-has-role-fn
Browse files Browse the repository at this point in the history
Update role checking new function
  • Loading branch information
AnuradhaSK authored Dec 19, 2023
2 parents 872582f + c18197b commit a3b4dae
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ This function redirects the user to an error page. It includes the parameters li
It is recommended to use an i18n key to describe the error messages so that they can be internationalized easily on the error page.
```js
var user = context.steps[1].subject;
var isAdmin = hasRole(user, 'admin');
var isAdmin = hasAnyOfTheRolesV2(context, ['admin']);
if (!isAdmin) {
sendError('http://www.example.com/error',{'status':'000403','statusMsg':'You are not allowed to login to this app.', 'i18nkey':'not.allowed.error'});
}
Expand Down

0 comments on commit a3b4dae

Please sign in to comment.