Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Metronic Access Control & Authorization


Hey, I wonder how I would add my own Login API using Axios to handle User Authorization? I also want to add Access Control so only certain users are able to see certain buttons & access certain pages. For instance, I will have admin on the same site, but I want the user to not see them anywhere, even in Web JavaScript Console.

I would really appreciate it if there is something that can help me achieve such. I've used CASL for Vue.js before, but it will let other users see the Admin Pages in the JavaScript Console (Different Admin Template than Metronic). Right now, I want to use ReactJS for this with Metronic.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hey, I do want to use my own API, no Laravel. I do want to know how I would control certain access that user views. For instance hide admin button & admin routes



Hi,

Typically, when restricting access for certain users, it's common practice to provide a flag like isAdmin or an array specifying user permissions from your server. You can then utilize this data to hide links and components for users without access. Use this flag for frontend content restriction, but do not forget to add the permission check on your backend as well.

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Hi,

Thank you for reaching out to us.

We do not have a user permission check functionality in our SPA applications. Please note, that our default application uses API based on Laravel.

To implement authentication with user permissions in Laravel API with React you can refer to the tutorial below:


Please let us know if you need any additional guidance.

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(