Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. const checkContextExists = (user, urlcontextid, appid) => {
  2. if (user.ApplicationContextRole) {
  3. const acr = daoHelper
  4. .deMapifyApplicationContextRole(user.ApplicationContextRole.M);
  5. if (acr[appid].contexts) {
  6. // Split string from url, as it comes in as type_id
  7. const contextType = getContextType(urlcontextid);
  8. const contextId = getContextId(urlcontextid);
  9. for (const context of acr[appid].contexts) {
  10. if (context.contextType.indexOf(contextType) > -1 &&
  11. context.contextId.indexOf(contextId) > -1) {
  12. return true;
  13. }
  14. }
  15. }
  16. }
  17.  
  18. return false;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement