Skip to content

Restrict user roles access to certain Sites #3421

@robinboening

Description

@robinboening

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions