I'd like to propose adding a feature that allows restricting specific user roles from accessing certain Sites.
I believe this could also be a valuable addition to Alchemy core, so I’m opening this issue to discuss whether the following approach makes sense.
My available time for this is somewhat limited, so my goal is to implement a simple, minimal version first. Not the fully fleshed-out solution that could come later with more time and exploration.
Proposed Scope
- Use CanCan to handle Site switching for the
author role (maintaining backward compatibility).
- Add an allowlist for roles to
Alchemy::Site via site_layouts.yml (defaulting to all roles being allowed for backward compatibility).
- At the lowest level possible, ensure
Current.site can only be set to an allowed Site.
- Use CanCan to restrict the site selector options to only show allowed Sites.
That's the general idea. Hopefully straightforward, without too many hidden rabbit holes.
What do you think about this approach?
I'd like to propose adding a feature that allows restricting specific user roles from accessing certain Sites.
I believe this could also be a valuable addition to Alchemy core, so I’m opening this issue to discuss whether the following approach makes sense.
My available time for this is somewhat limited, so my goal is to implement a simple, minimal version first. Not the fully fleshed-out solution that could come later with more time and exploration.
Proposed Scope
authorrole (maintaining backward compatibility).Alchemy::Siteviasite_layouts.yml(defaulting to all roles being allowed for backward compatibility).Current.sitecan only be set to an allowed Site.That's the general idea. Hopefully straightforward, without too many hidden rabbit holes.
What do you think about this approach?