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:
@@ -26,3 +26,12 @@
|
||||
# over the default routes. So, if you define a route for `/proposals`,
|
||||
# the default action for `/proposals` will not be used and the one you
|
||||
# define will be used instead.
|
||||
|
||||
constraints lambda { |request| !Rails.application.multitenancy_management_mode? } do
|
||||
# The routes defined within this block will not be accessible if multitenancy
|
||||
# management mode is enabled. If you need these routes to be accessible when
|
||||
# using multitenancy management mode, you should define them outside of this block.
|
||||
#
|
||||
# If multitenancy management mode is not being used, routes can be included within
|
||||
# this block and will still be accessible.
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user