From 3bafa41ecd909b6b575536df57edf18ac206fcde Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 30 Sep 2016 15:20:40 -0500 Subject: [PATCH] Add specific permissions for edit/delete of individual batch rows --- tailbone/views/master.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tailbone/views/master.py b/tailbone/views/master.py index 98c9ba9b..cb21e00a 100644 --- a/tailbone/views/master.py +++ b/tailbone/views/master.py @@ -1184,10 +1184,14 @@ class MasterView(View): if cls.has_rows and cls.rows_editable: config.add_route('{}.edit'.format(row_route_prefix), '{}/{{uuid}}/edit'.format(row_url_prefix)) config.add_view(cls, attr='edit_row', route_name='{}.edit'.format(row_route_prefix), - permission='{}.edit'.format(permission_prefix)) + permission='{}.edit_row'.format(permission_prefix)) + config.add_tailbone_permission(permission_prefix, '{}.edit_row'.format(permission_prefix), + "Edit individual {} rows".format(model_title)) # delete row if cls.has_rows and cls.rows_deletable: config.add_route('{}.delete'.format(row_route_prefix), '{}/{{uuid}}/delete'.format(row_url_prefix)) config.add_view(cls, attr='delete_row', route_name='{}.delete'.format(row_route_prefix), - permission='{}.edit'.format(permission_prefix)) + permission='{}.delete_row'.format(permission_prefix)) + config.add_tailbone_permission(permission_prefix, '{}.delete_row'.format(permission_prefix), + "Delete individual {} rows".format(model_title))