How to do rights management in REST based applications?Best Practices for securing a REST API / web serviceHow to handle complex authorisation rules in single page application?Where to implement a secure role-based page access in a MEAN stack Single Page Application?How do I implement Authorization with a Single Page Application and REST Backend?Client-side JWT role-based authorizationJWT Authorization in Angular 5Angular 6 - roles/claims based auth guard not workingKeycloak to authorize my REST API from admin consoleJWT for Resetting password with mfaExample code for: JWT + LDAP + DB Authorities + Secured REST

How to make a pipe-divided tuple?

Why did Tony's Arc Reactor do this?

Poor management handling of recent sickness and how to approach my return?

Statistical closeness implies computational indistinguishability

What is the purpose of the rotating plate in front of the lock?

Male viewpoint in an erotic novel

Supervisor wants me to support a diploma-thesis SW tool after I graduated

What is the extent of the commands a Cambion can issue through Fiendish Charm?

Leaving the USA

How can electricity be positive when electrons are negative?

Book/story which features a mental link to a prophet

How can I hint that my character isn't real?

Examples where "thin + thin = nice and thick"

How should Thaumaturgy's "three times as loud as normal" be interpreted?

What exactly is Apple Cider

Do 643,000 Americans go bankrupt every year due to medical bills?

What's this inadvertent thing?

Why did Boris Johnson call for new elections?

Bit floating sequence

More than 3 domains hosted on IP

After a few interviews, What should I do after told to wait?

Relationship between speed and cadence?

Why does 8 bit truecolor use only 2 bits for blue?

Fantasy Military Arms and Armor: the Dwarven Grand Armory



How to do rights management in REST based applications?


Best Practices for securing a REST API / web serviceHow to handle complex authorisation rules in single page application?Where to implement a secure role-based page access in a MEAN stack Single Page Application?How do I implement Authorization with a Single Page Application and REST Backend?Client-side JWT role-based authorizationJWT Authorization in Angular 5Angular 6 - roles/claims based auth guard not workingKeycloak to authorize my REST API from admin consoleJWT for Resetting password with mfaExample code for: JWT + LDAP + DB Authorities + Secured REST






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















So, I know how secure resources in REST backend that's not the issue. The problem I have is how to manage user/rights management on both the REST API and on the client applications/front-end?



Consider the following example, I have resources order and invoices in my API and I also have routes order, invoices and dashboard in my front-end application written in angular/react, for the sake of simplicity we should call those pages. I can store the rights in database for each role/user against end points and verbs that is fine however how do I manage the same thing on front-end? In the example it is possible that invoices, orders and dashboard can use both resources in some way so it's not a one to one relationship and from the perspective of the user it appears he has rights on pages. How do I maintain that relationship?



Should I store these front-end modules/pages/routes in the back-end as well by mapping it against REST endpoints however isn't such an approach violates the Single Responsibility principle as well as hinders the adaption of new client apps and scalability? If not should I encode the endpoints, verbs that user has access to in JWT and let the client app decides what to do with it using some kind of mapping between endpoints and pages on the client side however in this case I'll be increasing the size of JWT that grow exponentially when my endpoints increase?



My situation is even trickier in my case because front-end app is also responsible for assigning rights to the users. Think of it as a workflow engine or rights management where an admin user defines roles and gives permission to different pages (from the perspective of the user).



Can anyone tell me the best practices for implementing such kind of functionality. I didn't have such kind of problem in the old days without rest and web apps like JSF/ASP.NET because I have only one location to maintain the rights but REST based app changes those rules.










share|improve this question






























    1















    So, I know how secure resources in REST backend that's not the issue. The problem I have is how to manage user/rights management on both the REST API and on the client applications/front-end?



    Consider the following example, I have resources order and invoices in my API and I also have routes order, invoices and dashboard in my front-end application written in angular/react, for the sake of simplicity we should call those pages. I can store the rights in database for each role/user against end points and verbs that is fine however how do I manage the same thing on front-end? In the example it is possible that invoices, orders and dashboard can use both resources in some way so it's not a one to one relationship and from the perspective of the user it appears he has rights on pages. How do I maintain that relationship?



    Should I store these front-end modules/pages/routes in the back-end as well by mapping it against REST endpoints however isn't such an approach violates the Single Responsibility principle as well as hinders the adaption of new client apps and scalability? If not should I encode the endpoints, verbs that user has access to in JWT and let the client app decides what to do with it using some kind of mapping between endpoints and pages on the client side however in this case I'll be increasing the size of JWT that grow exponentially when my endpoints increase?



    My situation is even trickier in my case because front-end app is also responsible for assigning rights to the users. Think of it as a workflow engine or rights management where an admin user defines roles and gives permission to different pages (from the perspective of the user).



    Can anyone tell me the best practices for implementing such kind of functionality. I didn't have such kind of problem in the old days without rest and web apps like JSF/ASP.NET because I have only one location to maintain the rights but REST based app changes those rules.










    share|improve this question


























      1












      1








      1








      So, I know how secure resources in REST backend that's not the issue. The problem I have is how to manage user/rights management on both the REST API and on the client applications/front-end?



      Consider the following example, I have resources order and invoices in my API and I also have routes order, invoices and dashboard in my front-end application written in angular/react, for the sake of simplicity we should call those pages. I can store the rights in database for each role/user against end points and verbs that is fine however how do I manage the same thing on front-end? In the example it is possible that invoices, orders and dashboard can use both resources in some way so it's not a one to one relationship and from the perspective of the user it appears he has rights on pages. How do I maintain that relationship?



      Should I store these front-end modules/pages/routes in the back-end as well by mapping it against REST endpoints however isn't such an approach violates the Single Responsibility principle as well as hinders the adaption of new client apps and scalability? If not should I encode the endpoints, verbs that user has access to in JWT and let the client app decides what to do with it using some kind of mapping between endpoints and pages on the client side however in this case I'll be increasing the size of JWT that grow exponentially when my endpoints increase?



      My situation is even trickier in my case because front-end app is also responsible for assigning rights to the users. Think of it as a workflow engine or rights management where an admin user defines roles and gives permission to different pages (from the perspective of the user).



      Can anyone tell me the best practices for implementing such kind of functionality. I didn't have such kind of problem in the old days without rest and web apps like JSF/ASP.NET because I have only one location to maintain the rights but REST based app changes those rules.










      share|improve this question














      So, I know how secure resources in REST backend that's not the issue. The problem I have is how to manage user/rights management on both the REST API and on the client applications/front-end?



      Consider the following example, I have resources order and invoices in my API and I also have routes order, invoices and dashboard in my front-end application written in angular/react, for the sake of simplicity we should call those pages. I can store the rights in database for each role/user against end points and verbs that is fine however how do I manage the same thing on front-end? In the example it is possible that invoices, orders and dashboard can use both resources in some way so it's not a one to one relationship and from the perspective of the user it appears he has rights on pages. How do I maintain that relationship?



      Should I store these front-end modules/pages/routes in the back-end as well by mapping it against REST endpoints however isn't such an approach violates the Single Responsibility principle as well as hinders the adaption of new client apps and scalability? If not should I encode the endpoints, verbs that user has access to in JWT and let the client app decides what to do with it using some kind of mapping between endpoints and pages on the client side however in this case I'll be increasing the size of JWT that grow exponentially when my endpoints increase?



      My situation is even trickier in my case because front-end app is also responsible for assigning rights to the users. Think of it as a workflow engine or rights management where an admin user defines roles and gives permission to different pages (from the perspective of the user).



      Can anyone tell me the best practices for implementing such kind of functionality. I didn't have such kind of problem in the old days without rest and web apps like JSF/ASP.NET because I have only one location to maintain the rights but REST based app changes those rules.







      jwt authorization rights-management






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 5:57









      zhaiderzhaider

      1101 gold badge2 silver badges13 bronze badges




      1101 gold badge2 silver badges13 bronze badges

























          2 Answers
          2






          active

          oldest

          votes


















          0
















          The best way to handle this would be to create a High Order Component in react.



          1. After the user logs-in from the web frontend you should be able to identify his role.

          2. You need to create a mapping of roles to pages/components

          3. Use the high order component to render all other components which require authorization.

          4. In the high order component have the logic to render the page/component only if the user is authorized or else move him to some other custom error/login page.

          You can find more info here: https://www.codementor.io/sahilmittal/using-higher-order-components-for-authenticated-routing-i1hcp6pc6



          Hope that answers your question!!






          share|improve this answer

























          • Essentially it's the responsibility of the front-end app to map the pages/components to REST resources and back-end should keep track of it?

            – zhaider
            Mar 28 at 12:15











          • @zhaider You got it right!!

            – Jatin Nath Prusty
            Mar 29 at 12:35


















          0
















          You may want to take a look into State Management. If you're not sure, State Management is a series of unique variables that are held within a 'store' in your front-end application. You can mutate, get and set these variables throughout the application and readily accessible from anywhere. Plus, no state or session information is being held in your back-end so still RESTful!



          In your situation, when the User logs in, their Rights or Permissions may come as part of the JSON response or through the encoded JWT (that will help with managing the size of your JWT too, you won't have to put everything in there). The Rights are added into the state, and before the components are generated, you can check if the User has the correct permission and selectively load the components. You can do the same thing for function calls and API requests; no permission, no action.



          For your Rights Management, you can still maintain this through simple API requests, and when the User logs in next, their Rights are refreshed!



          There are several State Management libraries available for both React and Angular. The ones I am familiar with are Redux (React) and NGRX (Angular). There are also dozens of tutorials out there; you won't go wanting!






          share|improve this answer

























          • Okay, so if I understand you correctly, I'll be getting the user rights at the time of login in a response and not in JWT and store it locally. In other words backend will only notify what resources the user have access to and what actions it could perform then the front-end has to maintain all the mappings to the front-end components. Now there's one problem I could see arising from it, what will happen if the rights have been changed while the user is already logged in and he won't be able to see the new components he has access to.

            – zhaider
            Mar 28 at 12:13











          • That's exactly right. We have a few methods for updating the State privileges depending on the system: Firstly, we have a middleware that checks for privilege updates each time an API call is made, which would be any page or component. If there is an update, we expire their JWT which will log the user out OR we allow the Admin to make the choice to log them out. Next, Web Sockets to update the frontend when a privilege change is committed. And lastly, the good ol' Admin asks the user to log out and in.

            – ManChildMan
            Mar 29 at 2:29











          • Thanks for the clarification. Can you point me to some tutorials in NGRX and Redux specifically related to rights management?

            – zhaider
            Mar 30 at 8:33













          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55391007%2fhow-to-do-rights-management-in-rest-based-applications%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0
















          The best way to handle this would be to create a High Order Component in react.



          1. After the user logs-in from the web frontend you should be able to identify his role.

          2. You need to create a mapping of roles to pages/components

          3. Use the high order component to render all other components which require authorization.

          4. In the high order component have the logic to render the page/component only if the user is authorized or else move him to some other custom error/login page.

          You can find more info here: https://www.codementor.io/sahilmittal/using-higher-order-components-for-authenticated-routing-i1hcp6pc6



          Hope that answers your question!!






          share|improve this answer

























          • Essentially it's the responsibility of the front-end app to map the pages/components to REST resources and back-end should keep track of it?

            – zhaider
            Mar 28 at 12:15











          • @zhaider You got it right!!

            – Jatin Nath Prusty
            Mar 29 at 12:35















          0
















          The best way to handle this would be to create a High Order Component in react.



          1. After the user logs-in from the web frontend you should be able to identify his role.

          2. You need to create a mapping of roles to pages/components

          3. Use the high order component to render all other components which require authorization.

          4. In the high order component have the logic to render the page/component only if the user is authorized or else move him to some other custom error/login page.

          You can find more info here: https://www.codementor.io/sahilmittal/using-higher-order-components-for-authenticated-routing-i1hcp6pc6



          Hope that answers your question!!






          share|improve this answer

























          • Essentially it's the responsibility of the front-end app to map the pages/components to REST resources and back-end should keep track of it?

            – zhaider
            Mar 28 at 12:15











          • @zhaider You got it right!!

            – Jatin Nath Prusty
            Mar 29 at 12:35













          0














          0










          0









          The best way to handle this would be to create a High Order Component in react.



          1. After the user logs-in from the web frontend you should be able to identify his role.

          2. You need to create a mapping of roles to pages/components

          3. Use the high order component to render all other components which require authorization.

          4. In the high order component have the logic to render the page/component only if the user is authorized or else move him to some other custom error/login page.

          You can find more info here: https://www.codementor.io/sahilmittal/using-higher-order-components-for-authenticated-routing-i1hcp6pc6



          Hope that answers your question!!






          share|improve this answer













          The best way to handle this would be to create a High Order Component in react.



          1. After the user logs-in from the web frontend you should be able to identify his role.

          2. You need to create a mapping of roles to pages/components

          3. Use the high order component to render all other components which require authorization.

          4. In the high order component have the logic to render the page/component only if the user is authorized or else move him to some other custom error/login page.

          You can find more info here: https://www.codementor.io/sahilmittal/using-higher-order-components-for-authenticated-routing-i1hcp6pc6



          Hope that answers your question!!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 28 at 7:14









          Jatin Nath PrustyJatin Nath Prusty

          4383 silver badges15 bronze badges




          4383 silver badges15 bronze badges















          • Essentially it's the responsibility of the front-end app to map the pages/components to REST resources and back-end should keep track of it?

            – zhaider
            Mar 28 at 12:15











          • @zhaider You got it right!!

            – Jatin Nath Prusty
            Mar 29 at 12:35

















          • Essentially it's the responsibility of the front-end app to map the pages/components to REST resources and back-end should keep track of it?

            – zhaider
            Mar 28 at 12:15











          • @zhaider You got it right!!

            – Jatin Nath Prusty
            Mar 29 at 12:35
















          Essentially it's the responsibility of the front-end app to map the pages/components to REST resources and back-end should keep track of it?

          – zhaider
          Mar 28 at 12:15





          Essentially it's the responsibility of the front-end app to map the pages/components to REST resources and back-end should keep track of it?

          – zhaider
          Mar 28 at 12:15













          @zhaider You got it right!!

          – Jatin Nath Prusty
          Mar 29 at 12:35





          @zhaider You got it right!!

          – Jatin Nath Prusty
          Mar 29 at 12:35













          0
















          You may want to take a look into State Management. If you're not sure, State Management is a series of unique variables that are held within a 'store' in your front-end application. You can mutate, get and set these variables throughout the application and readily accessible from anywhere. Plus, no state or session information is being held in your back-end so still RESTful!



          In your situation, when the User logs in, their Rights or Permissions may come as part of the JSON response or through the encoded JWT (that will help with managing the size of your JWT too, you won't have to put everything in there). The Rights are added into the state, and before the components are generated, you can check if the User has the correct permission and selectively load the components. You can do the same thing for function calls and API requests; no permission, no action.



          For your Rights Management, you can still maintain this through simple API requests, and when the User logs in next, their Rights are refreshed!



          There are several State Management libraries available for both React and Angular. The ones I am familiar with are Redux (React) and NGRX (Angular). There are also dozens of tutorials out there; you won't go wanting!






          share|improve this answer

























          • Okay, so if I understand you correctly, I'll be getting the user rights at the time of login in a response and not in JWT and store it locally. In other words backend will only notify what resources the user have access to and what actions it could perform then the front-end has to maintain all the mappings to the front-end components. Now there's one problem I could see arising from it, what will happen if the rights have been changed while the user is already logged in and he won't be able to see the new components he has access to.

            – zhaider
            Mar 28 at 12:13











          • That's exactly right. We have a few methods for updating the State privileges depending on the system: Firstly, we have a middleware that checks for privilege updates each time an API call is made, which would be any page or component. If there is an update, we expire their JWT which will log the user out OR we allow the Admin to make the choice to log them out. Next, Web Sockets to update the frontend when a privilege change is committed. And lastly, the good ol' Admin asks the user to log out and in.

            – ManChildMan
            Mar 29 at 2:29











          • Thanks for the clarification. Can you point me to some tutorials in NGRX and Redux specifically related to rights management?

            – zhaider
            Mar 30 at 8:33















          0
















          You may want to take a look into State Management. If you're not sure, State Management is a series of unique variables that are held within a 'store' in your front-end application. You can mutate, get and set these variables throughout the application and readily accessible from anywhere. Plus, no state or session information is being held in your back-end so still RESTful!



          In your situation, when the User logs in, their Rights or Permissions may come as part of the JSON response or through the encoded JWT (that will help with managing the size of your JWT too, you won't have to put everything in there). The Rights are added into the state, and before the components are generated, you can check if the User has the correct permission and selectively load the components. You can do the same thing for function calls and API requests; no permission, no action.



          For your Rights Management, you can still maintain this through simple API requests, and when the User logs in next, their Rights are refreshed!



          There are several State Management libraries available for both React and Angular. The ones I am familiar with are Redux (React) and NGRX (Angular). There are also dozens of tutorials out there; you won't go wanting!






          share|improve this answer

























          • Okay, so if I understand you correctly, I'll be getting the user rights at the time of login in a response and not in JWT and store it locally. In other words backend will only notify what resources the user have access to and what actions it could perform then the front-end has to maintain all the mappings to the front-end components. Now there's one problem I could see arising from it, what will happen if the rights have been changed while the user is already logged in and he won't be able to see the new components he has access to.

            – zhaider
            Mar 28 at 12:13











          • That's exactly right. We have a few methods for updating the State privileges depending on the system: Firstly, we have a middleware that checks for privilege updates each time an API call is made, which would be any page or component. If there is an update, we expire their JWT which will log the user out OR we allow the Admin to make the choice to log them out. Next, Web Sockets to update the frontend when a privilege change is committed. And lastly, the good ol' Admin asks the user to log out and in.

            – ManChildMan
            Mar 29 at 2:29











          • Thanks for the clarification. Can you point me to some tutorials in NGRX and Redux specifically related to rights management?

            – zhaider
            Mar 30 at 8:33













          0














          0










          0









          You may want to take a look into State Management. If you're not sure, State Management is a series of unique variables that are held within a 'store' in your front-end application. You can mutate, get and set these variables throughout the application and readily accessible from anywhere. Plus, no state or session information is being held in your back-end so still RESTful!



          In your situation, when the User logs in, their Rights or Permissions may come as part of the JSON response or through the encoded JWT (that will help with managing the size of your JWT too, you won't have to put everything in there). The Rights are added into the state, and before the components are generated, you can check if the User has the correct permission and selectively load the components. You can do the same thing for function calls and API requests; no permission, no action.



          For your Rights Management, you can still maintain this through simple API requests, and when the User logs in next, their Rights are refreshed!



          There are several State Management libraries available for both React and Angular. The ones I am familiar with are Redux (React) and NGRX (Angular). There are also dozens of tutorials out there; you won't go wanting!






          share|improve this answer













          You may want to take a look into State Management. If you're not sure, State Management is a series of unique variables that are held within a 'store' in your front-end application. You can mutate, get and set these variables throughout the application and readily accessible from anywhere. Plus, no state or session information is being held in your back-end so still RESTful!



          In your situation, when the User logs in, their Rights or Permissions may come as part of the JSON response or through the encoded JWT (that will help with managing the size of your JWT too, you won't have to put everything in there). The Rights are added into the state, and before the components are generated, you can check if the User has the correct permission and selectively load the components. You can do the same thing for function calls and API requests; no permission, no action.



          For your Rights Management, you can still maintain this through simple API requests, and when the User logs in next, their Rights are refreshed!



          There are several State Management libraries available for both React and Angular. The ones I am familiar with are Redux (React) and NGRX (Angular). There are also dozens of tutorials out there; you won't go wanting!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 28 at 7:31









          ManChildManManChildMan

          544 bronze badges




          544 bronze badges















          • Okay, so if I understand you correctly, I'll be getting the user rights at the time of login in a response and not in JWT and store it locally. In other words backend will only notify what resources the user have access to and what actions it could perform then the front-end has to maintain all the mappings to the front-end components. Now there's one problem I could see arising from it, what will happen if the rights have been changed while the user is already logged in and he won't be able to see the new components he has access to.

            – zhaider
            Mar 28 at 12:13











          • That's exactly right. We have a few methods for updating the State privileges depending on the system: Firstly, we have a middleware that checks for privilege updates each time an API call is made, which would be any page or component. If there is an update, we expire their JWT which will log the user out OR we allow the Admin to make the choice to log them out. Next, Web Sockets to update the frontend when a privilege change is committed. And lastly, the good ol' Admin asks the user to log out and in.

            – ManChildMan
            Mar 29 at 2:29











          • Thanks for the clarification. Can you point me to some tutorials in NGRX and Redux specifically related to rights management?

            – zhaider
            Mar 30 at 8:33

















          • Okay, so if I understand you correctly, I'll be getting the user rights at the time of login in a response and not in JWT and store it locally. In other words backend will only notify what resources the user have access to and what actions it could perform then the front-end has to maintain all the mappings to the front-end components. Now there's one problem I could see arising from it, what will happen if the rights have been changed while the user is already logged in and he won't be able to see the new components he has access to.

            – zhaider
            Mar 28 at 12:13











          • That's exactly right. We have a few methods for updating the State privileges depending on the system: Firstly, we have a middleware that checks for privilege updates each time an API call is made, which would be any page or component. If there is an update, we expire their JWT which will log the user out OR we allow the Admin to make the choice to log them out. Next, Web Sockets to update the frontend when a privilege change is committed. And lastly, the good ol' Admin asks the user to log out and in.

            – ManChildMan
            Mar 29 at 2:29











          • Thanks for the clarification. Can you point me to some tutorials in NGRX and Redux specifically related to rights management?

            – zhaider
            Mar 30 at 8:33
















          Okay, so if I understand you correctly, I'll be getting the user rights at the time of login in a response and not in JWT and store it locally. In other words backend will only notify what resources the user have access to and what actions it could perform then the front-end has to maintain all the mappings to the front-end components. Now there's one problem I could see arising from it, what will happen if the rights have been changed while the user is already logged in and he won't be able to see the new components he has access to.

          – zhaider
          Mar 28 at 12:13





          Okay, so if I understand you correctly, I'll be getting the user rights at the time of login in a response and not in JWT and store it locally. In other words backend will only notify what resources the user have access to and what actions it could perform then the front-end has to maintain all the mappings to the front-end components. Now there's one problem I could see arising from it, what will happen if the rights have been changed while the user is already logged in and he won't be able to see the new components he has access to.

          – zhaider
          Mar 28 at 12:13













          That's exactly right. We have a few methods for updating the State privileges depending on the system: Firstly, we have a middleware that checks for privilege updates each time an API call is made, which would be any page or component. If there is an update, we expire their JWT which will log the user out OR we allow the Admin to make the choice to log them out. Next, Web Sockets to update the frontend when a privilege change is committed. And lastly, the good ol' Admin asks the user to log out and in.

          – ManChildMan
          Mar 29 at 2:29





          That's exactly right. We have a few methods for updating the State privileges depending on the system: Firstly, we have a middleware that checks for privilege updates each time an API call is made, which would be any page or component. If there is an update, we expire their JWT which will log the user out OR we allow the Admin to make the choice to log them out. Next, Web Sockets to update the frontend when a privilege change is committed. And lastly, the good ol' Admin asks the user to log out and in.

          – ManChildMan
          Mar 29 at 2:29













          Thanks for the clarification. Can you point me to some tutorials in NGRX and Redux specifically related to rights management?

          – zhaider
          Mar 30 at 8:33





          Thanks for the clarification. Can you point me to some tutorials in NGRX and Redux specifically related to rights management?

          – zhaider
          Mar 30 at 8:33


















          draft saved

          draft discarded















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55391007%2fhow-to-do-rights-management-in-rest-based-applications%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript