mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Return all templates for the user if the folder permissions flag is off
Putting the permission check in the get_user_template_folders allows us to replace `all_template_folders` usage with the new method without having to worry about the temporary service permission flag.
This commit is contained in:
committed by
Pea Tyczynska
parent
de237e9e6f
commit
1fb7a2515f
@@ -380,6 +380,9 @@ class Service():
|
||||
return {folder['id'] for folder in self.all_template_folders}
|
||||
|
||||
def get_user_template_folders(self, user_id):
|
||||
if not self.has_permission("edit_folder_permissions"):
|
||||
return self.all_template_folders
|
||||
|
||||
user_folders = []
|
||||
for folder in self.all_template_folders:
|
||||
if user_id not in folder.get("users_with_permission", []):
|
||||
|
||||
Reference in New Issue
Block a user