1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-25 03:43:33 +01:00

Respect Users are allowed to edit notes/replies setting

This commit is contained in:
FreeScout 2019-07-04 22:46:38 -07:00
parent a0ee0a7387
commit b90e68f23c
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ class ThreadPolicy
{
if ($thread->created_by_user_id
&& in_array($thread->type, [Thread::TYPE_MESSAGE, Thread::TYPE_NOTE])
&& ($user->isAdmin() || $thread->created_by_user_id == $user->ID)
&& ($user->isAdmin() || ($user->hasPermission(User::PERM_EDIT_CONVERSATIONS) && $thread->created_by_user_id == $user->id))
) {
return true;
} else {

View File

@ -406,7 +406,7 @@ class User extends Authenticatable
{
$user_permission_names = [
self::PERM_DELETE_CONVERSATIONS => __('Users are allowed to delete notes/conversations'),
self::PERM_EDIT_CONVERSATIONS => __('Users are allowed to edit notes/threads'),
self::PERM_EDIT_CONVERSATIONS => __('Users are allowed to edit notes/replies'),
self::PERM_EDIT_SAVED_REPLIES => __('Users are allowed to edit/delete saved replies'),
self::PERM_EDIT_TAGS => __('Users are allowed to manage tags'),
];