Modify admin layout to only manage tenants and admins
We only want to render the account link and login items in the header. And we want only render the Multitenancy and Administrators sections in the admin sidebar. We include the administrators management so it's possible to give permissions to other users to manage tenants. In order to restrict access to other sections by typing the URL or following a link, we're only enabling the rest of the routes when we aren't in the multitenancy management mode.
This commit is contained in:
@@ -15,6 +15,15 @@ describe Layout::AdminLoginItemsComponent do
|
||||
expect(page).not_to be_rendered
|
||||
end
|
||||
|
||||
it "is not rendered when multitenancy_management_mode is enabled" do
|
||||
allow(Rails.application.config).to receive(:multitenancy_management_mode).and_return(true)
|
||||
user = create(:administrator).user
|
||||
|
||||
render_inline Layout::AdminLoginItemsComponent.new(user)
|
||||
|
||||
expect(page).not_to be_rendered
|
||||
end
|
||||
|
||||
it "shows access to all places except officing to administrators" do
|
||||
user = create(:administrator).user
|
||||
|
||||
|
||||
Reference in New Issue
Block a user