FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Different Roles for Different Products

    Scheduled Pinned Locked Moved Unsolved
    Q&A
    2
    4
    403
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      matthieu
      last edited by

      Hello !
      I have one application for which I created a list of roles.
      In this application, a user can access several different products, but I would like my user to have some roles when he is accessing product 1, and other roles when accessing product 2.
      For now I use entity grants where the permissions are the list of my products to determine in my backend code if the user is allowed to access a product.
      But the problem is that if a user has permissions for 2 products, he will have the same list of roles for both products.

      The best would be to assign to a user, a pair role/product.
      Is there a way to do this ?

      Thank you

      mark.robustelliM 1 Reply Last reply Reply Quote 1
      • mark.robustelliM
        mark.robustelli @matthieu
        last edited by mark.robustelli

        @matthieu ,

        Why would the roles not work with the product as a prefix and the right as the suffix not work as a role?

        I.E.

        • product1_read
        • product1_write
        • product1_delete
        • prodcut2_read
        • product2_write
        • product2_delete
        M 1 Reply Last reply Reply Quote 0
        • M
          matthieu @mark.robustelli
          last edited by

          @mark-robustelli
          It would work, but I was looking for a method to avoid duplicating all the roles as they will be the same for all products.
          It would also mean I don't have to parse the role to separate the real role from the concerned product.

          mark.robustelliM 1 Reply Last reply Reply Quote 0
          • mark.robustelliM
            mark.robustelli @matthieu
            last edited by mark.robustelli

            @matthieu , that is understandable. Keep in mind if you are adding a lot of products often, you can use the APIs to help create and manage those permissions.

            I.E. Create an Application Role, Create an Entity, Update a User Registration (for updating roles)

            1 Reply Last reply Reply Quote 0
            • First post
              Last post