mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-07 16:18:25 -04:00
Add migration for user_folder_permissions table
Changed the user_to_service mapping table into a model called ServiceUser. When looking at users who have permission for a folder we are only interested in users for a particular service, not all users, so we can use the ServiceUser model to access folder permissions. Added a user_folder_permissions table which contains the service_id, user_id and template_folder_id. There are links between user_folder_permissions and TemplateFolder, and between user_folder_permissions and ServiceUser.
This commit is contained in:
@@ -361,7 +361,7 @@ def dao_resume_service(service_id):
|
||||
|
||||
def dao_fetch_active_users_for_service(service_id):
|
||||
query = User.query.filter(
|
||||
User.user_to_service.any(id=service_id),
|
||||
User.services.any(id=service_id),
|
||||
User.state == 'active'
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user