Disable management of canned messages for all but admins

This commit is contained in:
Fedor A. Fetisov 2018-01-12 00:32:18 +03:00
parent 8ced21fe86
commit 3179d5b669
3 changed files with 30 additions and 24 deletions

View File

@ -187,21 +187,24 @@ canned_message_add:
path: /operator/canned-message/add
defaults:
_controller: Mibew\Controller\CannedMessageController::showEditFormAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
methods: [GET]
canned_message_add_save:
path: /operator/canned-message/add
defaults:
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
methods: [POST]
canned_message_delete:
path: /operator/canned-message/{message_id}/delete
defaults:
_controller: Mibew\Controller\CannedMessageController::deleteAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
message_id: \d{1,10}
@ -209,7 +212,8 @@ canned_message_edit:
path: /operator/canned-message/{message_id}/edit
defaults:
_controller: Mibew\Controller\CannedMessageController::showEditFormAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
message_id: \d{1,10}
methods: [GET]
@ -218,7 +222,8 @@ canned_message_edit_save:
path: /operator/canned-message/{message_id}/edit
defaults:
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
requirements:
message_id: \d{1,10}
methods: [POST]
@ -227,7 +232,8 @@ canned_messages:
path: /operator/canned-message
defaults:
_controller: Mibew\Controller\CannedMessageController::indexAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
_access_check: Mibew\AccessControl\Check\PermissionsCheck
_access_permissions: [CAN_ADMINISTRATE]
## Groups
group_add:

View File

@ -22,11 +22,11 @@
{{/if}}
</ul>
</li>
<li>
<h2>{{l10n "Administration"}}</h2>
<ul class="submenu">
<li{{#ifEqual menuid "canned"}} class="active"{{/ifEqual}}><a href="{{route "canned_messages"}}">{{l10n "Canned Messages"}}</a></li>
{{#if showadmin}}
{{#if showadmin}}
<li>
<h2>{{l10n "Administration"}}</h2>
<ul class="submenu">
<li{{#ifEqual menuid "canned"}} class="active"{{/ifEqual}}><a href="{{route "canned_messages"}}">{{l10n "Canned Messages"}}</a></li>
<li{{#ifEqual menuid "getcode"}} class="active"{{/ifEqual}}><a href="{{route "button_code"}}">{{l10n "Button code"}}</a></li>
<li{{#ifEqual menuid "operators"}} class="active"{{/ifEqual}}><a href="{{route "operators"}}">{{l10n "Operators"}}</a></li>
<li{{#ifEqual menuid "groups"}} class="active"{{/ifEqual}}><a href="{{route "groups"}}">{{l10n "Groups"}}</a></li>
@ -35,9 +35,9 @@
<li{{#ifEqual menuid "styles"}} class="active"{{/ifEqual}}><a href="{{route "style_preview" type="page"}}">{{l10n "Styles"}}</a></li>
<li{{#ifEqual menuid "translation"}} class="active"{{/ifEqual}}><a href="{{route "translations"}}">{{l10n "Localize"}}</a></li>
<li{{#ifEqual menuid "mail_templates"}} class="active"{{/ifEqual}}><a href="{{route "mail_templates"}}">{{l10n "Mail templates"}}</a></li>
{{/if}}
</ul>
</li>
</ul>
</li>
{{/if}}
<li>
<h2>{{l10n "Other"}}</h2>
<ul class="submenu">

View File

@ -65,17 +65,17 @@
</div>
{{/if}}
<div class="dashboard-item">
<div class="dashboard-item-content">
<img src="{{asset "@CurrentStyle/images/dash/canned.png"}}" alt=""/>
<a href="{{route "canned_messages"}}">
{{l10n "Canned Messages"}}
</a>
{{l10n "Edit messages that you frequently type into the chat."}}
</div>
</div>
{{#if showadmin}}
<div class="dashboard-item">
<div class="dashboard-item-content">
<img src="{{asset "@CurrentStyle/images/dash/canned.png"}}" alt=""/>
<a href="{{route "canned_messages"}}">
{{l10n "Canned Messages"}}
</a>
{{l10n "Edit messages that you frequently type into the chat."}}
</div>
</div>
<div class="dashboard-item">
<div class="dashboard-item-content">
<img src="{{asset "@CurrentStyle/images/dash/wizard.png"}}" alt=""/>