Trying to do some basic customization of the admin controller. I want only people that belong to a group that has the permission "admin_menu" to be able to access the admin menu.
I have done this ...
class CustomAdminConfig(TGAdminConfig):
allow_only = predicates.has_permission('admin_menu')
admin = AdminController(model, DBSession, config_type=CustomAdminConfig)
However i still get the error that the user has to be in the group managers. So looking at the parent classes
CustomAdminConfig --> BootstrapTgAdminConfig --> TGAdminConfig --> AdminConfig
allow_only overrides AdminConfig attribute which by default is set to None.
class AdminConfig(object):
DefaultControllerConfig = CrudRestControllerConfig
layout = BasicAdminLayout
default_index_template = None
allow_only = None
include_left_menu = True
The class docs state that allow_only defaults to predicates.in_group('managers'). I can't find anywhere in the code that actually applies this default so as a side question can you point me to where that happens out of curiosity?