Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const checkContextExists = (user, urlcontextid, appid) => {
- if (user.ApplicationContextRole) {
- const acr = daoHelper
- .deMapifyApplicationContextRole(user.ApplicationContextRole.M);
- if (acr[appid].contexts) {
- // Split string from url, as it comes in as type_id
- const contextType = getContextType(urlcontextid);
- const contextId = getContextId(urlcontextid);
- for (const context of acr[appid].contexts) {
- if (context.contextType.indexOf(contextType) > -1 &&
- context.contextId.indexOf(contextId) > -1) {
- return true;
- }
- }
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement