new: [settings:inbox.data_change_notify_for_all] Added setting to be more verbose for data changes
parent
eefe6b22cc
commit
ecc421b326
|
@ -73,7 +73,10 @@ class NotifyAdminsBehavior extends Behavior
|
|||
public function isNotificationAllowed(EventInterface $event, EntityInterface $entity, ArrayObject $options): bool
|
||||
{
|
||||
$loggedUser = Configure::read('loggedUser');
|
||||
if (empty($loggedUser) || !empty($loggedUser['role']['perm_admin']) || !empty($loggedUser['role']['perm_sync'])) {
|
||||
if (
|
||||
empty(Configure::read('inbox.data_change_notify_for_all', false)) &&
|
||||
(empty($loggedUser) || !empty($loggedUser['role']['perm_admin']) || !empty($loggedUser['role']['perm_sync']))
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -351,7 +351,20 @@ class CerebrateSettingsProvider extends BaseSettingsProvider
|
|||
],
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
'Inbox' => [
|
||||
'Data change notification' => [
|
||||
'Data change notification' => [
|
||||
'inbox.data_change_notify_for_all' => [
|
||||
'name' => __('Notify data modification for all Users'),
|
||||
'type' => 'boolean',
|
||||
'description' => __('Turning this option ON will alert administrators whenever data is modified, irrespective of the user\'s role responsible for the modification.'),
|
||||
'default' => false,
|
||||
'severity' => 'warning',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
/*
|
||||
'Features' => [
|
||||
'Demo Settings' => [
|
||||
|
|
Loading…
Reference in New Issue