- map.connect('/users/{id};{name}', controller='users', action='profile',
- conditions=dict(function=id_is_numeric))
- map.connect('/users/{id}', controller='users', action='profile',
- conditions=dict(function=id_is_numeric))
+ map.connect(r'/users/{id:\d+};{name}', controller='users', action='profile')
+ map.connect(r'/users/{id:\d+}', controller='users', action='profile')
+
+ # Big-boy admin
+ map.connect('/admin/users/permissions', controller='admin_users', action='permissions')
+
+def monkeypatch_user_hook(config, *args, **kwargs):
+ """Hook to tell the `User` model who the root user is."""
+ try:
+ users_model.User._root_user_id \
+ = int(config['spline-users.root_user_id'])
+ except KeyError:
+ # No config set; oh well!
+ pass