Using Strapi to build an API. Love most of it, but it seems access to the admin interface is all or nothing; you can't hide the more advanced aspects of admin for users who should only be able to add/edit content...? Am I missing something? How is this done?
Actually you can change some things, since there is an /admin
folder inside of /node_modules
that you can overwrite, as the documentation says here, you can overwrite some logic for specific users and specific cases, that's not the best way to do it, but it's what we have for now.
Example: In my project I don't want any user to access the Content-Types Builder on production, at the end, I decided to hide the entire Plugins section on production environment.
So firstly I copied the entire /admin folder inside of my project, that way it'd be simple to find/edit any component.
Secondly I searched were the sections where rendered, and I found this file:
/my-project/admin/src/components/LeftMenuLinkSection/index.js
And I added this inside of the component:
const LeftMenuLinksSection = ({ section,
....
// before the return
if ( section === 'plugins' && process.env.NODE_ENV !== 'development') return null;;
And it worked, on production I don't have the plugins section on admin left menu (image 1):
It depends what you want to do, that could be possible, so it's not "all or nothing", it's more like all or almost nothing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With