Can I conditionally display one of the icons on the sidebar depending on the user?

I’d like to hide certain modules for certain users.

Back in the days this was possible based on a role. But they removed it so now your stuck with the default setup... You could try to use a hook to change it but it wont be a nice solution

3 Answers

3

I looked into this as well and it might be possible with a hook as per this blog post

Actually I’m wondering too how we can do so :sweat_smile:
Plus for the collections too, I’m using a workaround to do this, but wondering if it’s supported somehow

In collections, you can do this using policies.. for example, if you limit a user permission to read a collection, that collection will not be shown. But for modules, i have no idea..

In some cases, we need to allow specific role to have access for read, but we don't want him to view the module/collection on the left side.

Have you found a solution for hiding collections? I also have the case where I would like to hide a collection, but need read access :/

@Deborah maybe you should use API user to read access and don't give app access to that user. So user can read (via API) and can't open the collection. Or, you just make the collection invisible (make it hidden in collection option), but if user know name of collection, they still can access it via admin/content/collection.

Directus currently doesn’t have a native way to show/hide the roles on a per-user or per-role level. They can globally be shown/hidden from the project settings. I’ve jotted down your feedback on our end so it’ll be considered for a future revision.