mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
When adding a user new with permissions to a service, the permissions
dao was deleting all permissions for that user (regardless of service id) as the last filter on the permissions dao get_query method won. I've added a replace flag to the set_user_service_permission method so that it can handle adding new users + permissions and editing of existing users' permissions. Also by pass the get_query method until it can be refactored to work correctly. For now execute the filter query directly on the model.
This commit is contained in:
@@ -188,7 +188,7 @@ def set_permissions(user_id, service_id):
|
||||
for p in permissions:
|
||||
p.user = user
|
||||
p.service = service
|
||||
permission_dao.set_user_service_permission(user, service, permissions, _commit=True)
|
||||
permission_dao.set_user_service_permission(user, service, permissions, _commit=True, replace=True)
|
||||
return jsonify({}), 204
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user