b1gw0rm - 10 months ago

I would like to setup a fully customized dashboard for a particular user group. In particular, I'd like to control what they see on the menu. In addition, I'd like them to only be able to add and edit data from certain Streams. I don't want them to see any other Stream options like Fields, Namespaces or the main Stream landing page. What would be the Pyro way to do these things.

ryanthompson - 10 months ago

Howdy!

When you say "dashboard" do you mean the control panel in general? Or a custom dashboard using the dashboard module.

Either way you can certainly hide / show things based on permissions. Let's hear a little more information and we'll go from there ^_^

b1gw0rm - 10 months ago

In this case I'm referring to the control panel. Ideally I'd like to send a certain user group to a particular custom admin theme but keep the normal Accelerant theme for full admins. However, if it's easier to create one custom admin theme using the artisan make:addon my_client.theme.awesome, with the the admin flag in the Theme.php file, and then using that for all user types, hiding/showing as needed I'm fine to go that route as well.

ryanthompson - 10 months ago

You can certainly switch the theme based on the user role. Anytime during the boot process (service provider) you can override the streams::themes.admin config value with something like foo.theme.example_admin or whatever you would like the theme to become on that load.

This command is dispatched JUST after all the addons register during the boot process: https://github.com/anomalylabs/streams-platform/blob/1.3/src/Addon/Theme/Command/LoadCurrentTheme.php

Here's where it's fired: https://github.com/anomalylabs/streams-platform/blob/1.3/src/StreamsServiceProvider.php#L273