Skip to content

Instantly share code, notes, and snippets.

@ibihim
Created September 5, 2017 07:45
Show Gist options
  • Select an option

  • Save ibihim/194d2422ef24e0fa425f08c24e416e07 to your computer and use it in GitHub Desktop.

Select an option

Save ibihim/194d2422ef24e0fa425f08c24e416e07 to your computer and use it in GitHub Desktop.

Revisions

  1. ibihim created this gist Sep 5, 2017.
    7 changes: 7 additions & 0 deletions roles.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    const getAuthData = (users) =>
    users.reduce((authObj, user) => {
    const { roles, organizations, clients } = user;
    authObj.userRoles.push(roles.toStirng());
    authObj.organizations.push(organizations.toString()) ;
    authObj.userClient.push(clients.toSring()) ;
    }, { userRoles: [], organizaionts: [], userClients: [] });