Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update role checking new function #4262

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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