Add a user method to check folder permission

User model is the most natural place for a permission check method,
however this means that we need to pass the full user object to
service model methods and TemplateList instead of user_id.
This commit is contained in:
Alexey Bezhan
2019-03-11 14:13:56 +00:00
parent 0f9207a161
commit e6d7f7ebeb
7 changed files with 42 additions and 36 deletions

View File

@@ -52,7 +52,7 @@ def conversation_reply(
templates_and_folders=TemplateList(
current_service,
template_folder_id=from_folder,
user_id=current_user.id,
user=current_user,
template_type='sms'
),
template_folder_path=current_service.get_template_folder_path(from_folder),