From efc606cb9132ea19630c0294ddb9761cf659d3b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20D?= Date: Thu, 16 Nov 2023 06:49:25 +0100 Subject: [PATCH] chore(tests): UT for ACL actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rubén D --- .../Controllers/Account/CreateController.php | 4 +- .../Controllers/Account/DeleteController.php | 4 +- .../Controllers/Account/EditController.php | 4 +- .../Account/EditPassController.php | 4 +- .../Controllers/Account/SearchController.php | 6 +- .../Controllers/Account/ViewController.php | 4 +- .../Account/ViewPassController.php | 4 +- .../Controllers/Category/CreateController.php | 4 +- .../Controllers/Category/DeleteController.php | 4 +- .../Controllers/Category/EditController.php | 4 +- .../Controllers/Category/SearchController.php | 4 +- .../Controllers/Category/ViewController.php | 4 +- .../Controllers/Client/CreateController.php | 4 +- .../Controllers/Client/DeleteController.php | 4 +- .../api/Controllers/Client/EditController.php | 4 +- .../Controllers/Client/SearchController.php | 4 +- .../api/Controllers/Client/ViewController.php | 4 +- .../Controllers/Config/BackupController.php | 4 +- .../Controllers/Config/ExportController.php | 4 +- .../api/Controllers/Tag/CreateController.php | 4 +- .../api/Controllers/Tag/DeleteController.php | 4 +- .../api/Controllers/Tag/EditController.php | 4 +- .../api/Controllers/Tag/SearchController.php | 4 +- .../api/Controllers/Tag/ViewController.php | 4 +- .../UserGroup/CreateController.php | 4 +- .../UserGroup/DeleteController.php | 4 +- .../Controllers/UserGroup/EditController.php | 4 +- .../UserGroup/SearchController.php | 4 +- .../Controllers/UserGroup/ViewController.php | 4 +- .../AccessManager/IndexController.php | 14 +- .../Controllers/Account/CopyController.php | 4 +- .../Controllers/Account/CreateController.php | 4 +- .../Controllers/Account/DeleteController.php | 4 +- .../Controllers/Account/EditController.php | 4 +- .../Account/EditPassController.php | 4 +- .../Account/RequestAccessController.php | 4 +- .../Account/SaveCopyController.php | 8 +- .../Account/SaveCreateController.php | 8 +- .../Account/SaveDeleteController.php | 4 +- .../Account/SaveEditController.php | 8 +- .../Account/SaveEditPassController.php | 6 +- .../Account/SaveEditRestoreController.php | 4 +- .../Account/SaveRequestController.php | 6 +- .../Controllers/Account/ViewController.php | 4 +- .../Account/ViewHistoryController.php | 4 +- .../Account/ViewLinkController.php | 6 +- .../AccountFile/ListController.php | 8 +- .../AccountFile/SearchController.php | 6 +- .../SearchController.php | 6 +- .../AccountManager/BulkEditController.php | 6 +- .../AccountManager/DeleteController.php | 6 +- .../AccountManager/SaveBulkEditController.php | 4 +- .../AccountManager/SearchController.php | 6 +- .../AuthToken/AuthTokenViewBase.php | 8 +- .../AuthToken/CreateController.php | 4 +- .../AuthToken/DeleteController.php | 8 +- .../Controllers/AuthToken/EditController.php | 4 +- .../AuthToken/SaveCreateController.php | 8 +- .../AuthToken/SaveEditController.php | 8 +- .../AuthToken/SearchController.php | 6 +- .../Controllers/AuthToken/ViewController.php | 4 +- .../Controllers/Category/CategoryViewBase.php | 10 +- .../Controllers/Category/CreateController.php | 4 +- .../Controllers/Category/DeleteController.php | 8 +- .../Controllers/Category/EditController.php | 4 +- .../Controllers/Category/SaveCreateAction.php | 8 +- .../Category/SaveEditController.php | 8 +- .../Controllers/Category/SearchController.php | 6 +- .../Controllers/Category/ViewController.php | 4 +- .../web/Controllers/Client/ClientViewBase.php | 10 +- .../Controllers/Client/CreateController.php | 4 +- .../Controllers/Client/DeleteController.php | 8 +- .../web/Controllers/Client/EditController.php | 4 +- .../Client/SaveCreateController.php | 8 +- .../Controllers/Client/SaveEditController.php | 8 +- .../Controllers/Client/SearchController.php | 6 +- .../web/Controllers/Client/ViewController.php | 4 +- .../ConfigAccount/SaveController.php | 4 +- .../DownloadBackupAppController.php | 4 +- .../DownloadBackupDbController.php | 4 +- .../ConfigBackup/DownloadExportController.php | 4 +- .../ConfigBackup/FileBackupController.php | 4 +- .../ConfigBackup/XmlExportController.php | 4 +- .../ConfigEncryption/RefreshController.php | 4 +- .../ConfigEncryption/SaveController.php | 4 +- .../ConfigEncryption/SaveTempController.php | 4 +- .../ConfigGeneral/DownloadConfigBackup.php | 4 +- .../ConfigGeneral/DownloadLogController.php | 4 +- .../ConfigGeneral/SaveController.php | 4 +- .../ConfigImport/ImportController.php | 4 +- .../ConfigLdap/CheckController.php | 4 +- .../ConfigLdap/CheckImportController.php | 4 +- .../ConfigLdap/ImportController.php | 4 +- .../Controllers/ConfigLdap/SaveController.php | 4 +- .../ConfigMail/CheckController.php | 4 +- .../Controllers/ConfigMail/SaveController.php | 4 +- .../ConfigManager/IndexController.php | 22 +- .../Controllers/ConfigWiki/SaveController.php | 4 +- .../CustomField/CreateController.php | 4 +- .../CustomField/CustomFieldViewBase.php | 6 +- .../CustomField/DeleteController.php | 4 +- .../CustomField/EditController.php | 4 +- .../CustomField/SaveCreateController.php | 6 +- .../CustomField/SaveEditController.php | 6 +- .../CustomField/SearchController.php | 6 +- .../CustomField/ViewController.php | 4 +- .../Controllers/Eventlog/IndexController.php | 8 +- .../Controllers/Eventlog/SearchController.php | 6 +- .../Helpers/Account/AccountActionsHelper.php | 88 ++--- .../Helpers/Account/AccountHelper.php | 22 +- .../Helpers/Account/AccountPasswordHelper.php | 6 +- .../Helpers/Account/AccountSearchHelper.php | 16 +- .../Controllers/Helpers/Grid/AccountGrid.php | 24 +- .../Helpers/Grid/AccountHistoryGrid.php | 18 +- .../Helpers/Grid/AuthTokenGrid.php | 26 +- .../Controllers/Helpers/Grid/CategoryGrid.php | 22 +- .../Controllers/Helpers/Grid/ClientGrid.php | 22 +- .../Helpers/Grid/CustomFieldGrid.php | 22 +- .../Controllers/Helpers/Grid/EventlogGrid.php | 18 +- .../web/Controllers/Helpers/Grid/FileGrid.php | 22 +- .../Helpers/Grid/ItemPresetGrid.php | 32 +- .../Helpers/Grid/NotificationGrid.php | 34 +- .../Controllers/Helpers/Grid/PluginGrid.php | 34 +- .../Helpers/Grid/PublicLinkGrid.php | 26 +- .../web/Controllers/Helpers/Grid/TagGrid.php | 22 +- .../Controllers/Helpers/Grid/TrackGrid.php | 30 +- .../web/Controllers/Helpers/Grid/UserGrid.php | 30 +- .../Helpers/Grid/UserGroupGrid.php | 26 +- .../Helpers/Grid/UserProfileGrid.php | 26 +- .../web/Controllers/Helpers/LayoutHelper.php | 50 +-- .../ItemManager/IndexController.php | 20 +- .../ItemPreset/CreateController.php | 4 +- .../ItemPreset/DeleteController.php | 4 +- .../Controllers/ItemPreset/EditController.php | 4 +- .../ItemPreset/ItemPresetViewBase.php | 6 +- .../ItemPreset/SaveCreateController.php | 6 +- .../ItemPreset/SaveEditController.php | 6 +- .../ItemPreset/SearchController.php | 6 +- .../Controllers/ItemPreset/ViewController.php | 4 +- .../Notification/CheckController.php | 4 +- .../Notification/CreateController.php | 4 +- .../Notification/EditController.php | 4 +- .../Notification/IndexController.php | 8 +- .../Notification/NotificationViewBase.php | 6 +- .../Notification/SaveCreateController.php | 6 +- .../Notification/SaveEditController.php | 6 +- .../Notification/SearchController.php | 6 +- .../Notification/ViewController.php | 4 +- .../Controllers/Plugin/DeleteController.php | 4 +- .../Controllers/Plugin/IndexController.php | 8 +- .../Controllers/Plugin/SearchController.php | 8 +- .../web/Controllers/Plugin/ViewController.php | 6 +- .../PublicLink/CreateController.php | 4 +- .../PublicLink/DeleteController.php | 4 +- .../Controllers/PublicLink/EditController.php | 4 +- .../PublicLink/PublicLinkController.php | 4 +- .../PublicLink/PublicLinkViewBase.php | 6 +- .../PublicLink/RefreshController.php | 4 +- .../web/Controllers/PublicLink/SaveCreate.php | 6 +- .../SaveCreateFromAccountController.php | 4 +- .../PublicLink/SearchController.php | 6 +- .../SecurityManager/IndexController.php | 8 +- .../web/Controllers/Tag/CreateController.php | 4 +- .../web/Controllers/Tag/DeleteController.php | 8 +- .../web/Controllers/Tag/EditController.php | 4 +- .../Controllers/Tag/SaveCreateController.php | 6 +- .../Controllers/Tag/SaveEditController.php | 6 +- .../web/Controllers/Tag/SearchController.php | 6 +- .../web/Controllers/Tag/TagViewBase.php | 6 +- .../web/Controllers/Tag/ViewController.php | 4 +- .../web/Controllers/Track/ClearController.php | 4 +- .../Controllers/Track/SearchController.php | 6 +- .../Controllers/Track/UnlockController.php | 4 +- .../Controllers/Upgrade/IndexController.php | 7 +- .../web/Controllers/User/CreateController.php | 4 +- .../web/Controllers/User/DeleteController.php | 8 +- .../web/Controllers/User/EditController.php | 4 +- .../Controllers/User/EditPassController.php | 4 +- .../Controllers/User/SaveCreateController.php | 8 +- .../Controllers/User/SaveEditController.php | 8 +- .../User/SaveEditPassController.php | 6 +- .../web/Controllers/User/SearchController.php | 6 +- .../web/Controllers/User/UserViewBase.php | 10 +- .../web/Controllers/User/ViewController.php | 4 +- .../UserGroup/CreateController.php | 4 +- .../UserGroup/DeleteController.php | 8 +- .../Controllers/UserGroup/EditController.php | 4 +- .../UserGroup/SaveCreateController.php | 8 +- .../UserGroup/SaveEditController.php | 8 +- .../UserGroup/SearchController.php | 6 +- .../UserGroup/UserGroupViewBase.php | 10 +- .../Controllers/UserGroup/ViewController.php | 4 +- .../UserProfile/CreateController.php | 4 +- .../UserProfile/DeleteController.php | 8 +- .../UserProfile/EditController.php | 4 +- .../UserProfile/SaveCreateController.php | 8 +- .../UserProfile/SaveEditController.php | 8 +- .../UserProfile/SearchController.php | 6 +- .../UserProfile/UserProfileViewBase.php | 10 +- .../UserProfile/ViewController.php | 4 +- .../UserSettingsManager/IndexController.php | 4 +- app/modules/web/Forms/AccountForm.php | 14 +- app/modules/web/Forms/AuthTokenForm.php | 10 +- app/modules/web/Forms/CategoryForm.php | 10 +- app/modules/web/Forms/ClientForm.php | 10 +- app/modules/web/Forms/CustomFieldDefForm.php | 10 +- app/modules/web/Forms/ItemsPresetForm.php | 8 +- app/modules/web/Forms/NotificationForm.php | 10 +- app/modules/web/Forms/PublicLinkForm.php | 10 +- app/modules/web/Forms/TagForm.php | 10 +- app/modules/web/Forms/UserForm.php | 14 +- app/modules/web/Forms/UserGroupForm.php | 10 +- app/modules/web/Forms/UserProfileForm.php | 10 +- .../views/account/search-rows.inc | 6 +- lib/SP/Core/Acl/Acl.php | 10 +- lib/SP/Core/Acl/AclActionsInterface.php | 192 ++++++++++ lib/SP/Core/Acl/Actions.php | 40 +-- lib/SP/Core/Acl/ActionsInterface.php | 176 +-------- lib/SP/Core/Definitions/CoreDefinitions.php | 3 +- lib/SP/DataModel/ActionData.php | 36 +- .../Account/Adapters/AccountAdapter.php | 8 +- .../Search/AccountSearchDataBuilder.php | 6 +- lib/SP/Domain/Account/Services/AccountAcl.php | 80 ++--- .../Account/Services/AccountAclService.php | 22 +- .../Domain/Auth/Services/AuthTokenService.php | 74 ++-- .../Auth/Services/UpgradeAuthTokenService.php | 46 +-- .../Category/Adapters/CategoryAdapter.php | 8 +- .../Domain/Client/Adapters/ClientAdapter.php | 8 +- .../Services/CustomFieldDefService.php | 14 +- .../UpgradeCustomFieldDataService.php | 12 +- .../UpgradeCustomFieldDefinitionService.php | 12 +- lib/SP/Infrastructure/File/FileCache.php | 3 +- lib/SP/Infrastructure/File/FileCacheBase.php | 7 +- .../File/FileCacheInterface.php | 2 +- lib/SP/Infrastructure/File/FileHandler.php | 22 +- .../File/FileHandlerInterface.php | 12 +- .../File/XmlFileStorageInterface.php | 12 +- lib/SP/Infrastructure/File/XmlHandler.php | 33 +- tests/SP/Core/Acl/ActionsTest.php | 337 ++++++++++++++++++ .../Services/AccountAclServiceTest.php | 86 ++--- .../SP/Domain/Api/Services/ApiServiceTest.php | 8 +- tests/SP/Modules/Api/ApiTestCase.php | 62 ++-- .../Api/Controllers/AccountControllerTest.php | 38 +- .../Controllers/CategoryControllerTest.php | 26 +- .../Api/Controllers/ClientControllerTest.php | 26 +- .../Api/Controllers/ConfigControllerTest.php | 24 +- .../Api/Controllers/TagControllerTest.php | 26 +- .../Controllers/UserGroupControllerTest.php | 26 +- .../Repositories/AuthTokenRepositoryTest.php | 38 +- .../CustomFieldDefRepositoryTest.php | 18 +- .../CustomFieldRepositoryTest.php | 86 ++--- tests/SP/Services/Api/ApiServiceTest.php | 24 +- .../AuthToken/AuthTokenServiceTest.php | 40 +-- .../CustomField/CustomFieldDefServiceTest.php | 22 +- .../CustomField/CustomFieldServiceTest.php | 68 ++-- 255 files changed, 1949 insertions(+), 1577 deletions(-) create mode 100644 lib/SP/Core/Acl/AclActionsInterface.php create mode 100644 tests/SP/Core/Acl/ActionsTest.php diff --git a/app/modules/api/Controllers/Account/CreateController.php b/app/modules/api/Controllers/Account/CreateController.php index 1041d0ff..c9c1acd5 100644 --- a/app/modules/api/Controllers/Account/CreateController.php +++ b/app/modules/api/Controllers/Account/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Account\Dtos\AccountRequest; @@ -43,7 +43,7 @@ final class CreateController extends AccountBase public function createAction(): void { try { - $this->setupApi(ActionsInterface::ACCOUNT_CREATE); + $this->setupApi(AclActionsInterface::ACCOUNT_CREATE); $accountRequest = $this->buildAccountRequest(); diff --git a/app/modules/api/Controllers/Account/DeleteController.php b/app/modules/api/Controllers/Account/DeleteController.php index a17dbfcd..c1a23f72 100644 --- a/app/modules/api/Controllers/Account/DeleteController.php +++ b/app/modules/api/Controllers/Account/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Api\Services\ApiResponse; @@ -42,7 +42,7 @@ final class DeleteController extends AccountBase public function deleteAction(): void { try { - $this->setupApi(ActionsInterface::ACCOUNT_DELETE); + $this->setupApi(AclActionsInterface::ACCOUNT_DELETE); $id = $this->apiService->getParamInt('id', true); diff --git a/app/modules/api/Controllers/Account/EditController.php b/app/modules/api/Controllers/Account/EditController.php index a910612b..8933f544 100644 --- a/app/modules/api/Controllers/Account/EditController.php +++ b/app/modules/api/Controllers/Account/EditController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Api\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Account\Dtos\AccountRequest; @@ -42,7 +42,7 @@ final class EditController extends AccountBase public function editAction(): void { try { - $this->setupApi(ActionsInterface::ACCOUNT_EDIT); + $this->setupApi(AclActionsInterface::ACCOUNT_EDIT); $accountRequest = $this->buildAccountRequest(); diff --git a/app/modules/api/Controllers/Account/EditPassController.php b/app/modules/api/Controllers/Account/EditPassController.php index ee2dfd7a..d8a3183d 100644 --- a/app/modules/api/Controllers/Account/EditPassController.php +++ b/app/modules/api/Controllers/Account/EditPassController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Api\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Account\Dtos\AccountRequest; @@ -42,7 +42,7 @@ final class EditPassController extends AccountBase public function editPassAction(): void { try { - $this->setupApi(ActionsInterface::ACCOUNT_EDIT_PASS); + $this->setupApi(AclActionsInterface::ACCOUNT_EDIT_PASS); $accountRequest = $this->buildAccountRequest(); diff --git a/app/modules/api/Controllers/Account/SearchController.php b/app/modules/api/Controllers/Account/SearchController.php index 9128a12e..d5b5a338 100644 --- a/app/modules/api/Controllers/Account/SearchController.php +++ b/app/modules/api/Controllers/Account/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -27,7 +27,7 @@ namespace SP\Modules\Api\Controllers\Account; use Exception; use Klein\Klein; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Domain\Account\Ports\AccountSearchServiceInterface; use SP\Domain\Account\Search\AccountSearchConstants; @@ -61,7 +61,7 @@ final class SearchController extends ControllerBase public function searchAction(): void { try { - $this->setupApi(ActionsInterface::ACCOUNT_SEARCH); + $this->setupApi(AclActionsInterface::ACCOUNT_SEARCH); $accountSearchFilter = $this->buildAccountSearchFilter(); diff --git a/app/modules/api/Controllers/Account/ViewController.php b/app/modules/api/Controllers/Account/ViewController.php index c2f701b1..9602a626 100644 --- a/app/modules/api/Controllers/Account/ViewController.php +++ b/app/modules/api/Controllers/Account/ViewController.php @@ -27,7 +27,7 @@ namespace SP\Modules\Api\Controllers\Account; use Exception; use League\Fractal\Resource\Item; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Account\Dtos\AccountEnrichedDto; @@ -46,7 +46,7 @@ final class ViewController extends AccountBase { try { - $this->setupApi(ActionsInterface::ACCOUNT_VIEW); + $this->setupApi(AclActionsInterface::ACCOUNT_VIEW); $id = $this->apiService->getParamInt('id', true); $customFields = Util::boolval($this->apiService->getParamString('customFields')); diff --git a/app/modules/api/Controllers/Account/ViewPassController.php b/app/modules/api/Controllers/Account/ViewPassController.php index 552b4981..f074da8c 100644 --- a/app/modules/api/Controllers/Account/ViewPassController.php +++ b/app/modules/api/Controllers/Account/ViewPassController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Crypt\Crypt; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -43,7 +43,7 @@ final class ViewPassController extends AccountBase public function viewPassAction(): void { try { - $this->setupApi(ActionsInterface::ACCOUNT_VIEW_PASS); + $this->setupApi(AclActionsInterface::ACCOUNT_VIEW_PASS); $id = $this->apiService->getParamInt('id', true); $accountPassData = $this->accountService->getPasswordForId($id); diff --git a/app/modules/api/Controllers/Category/CreateController.php b/app/modules/api/Controllers/Category/CreateController.php index 2749db58..1f80b6e7 100644 --- a/app/modules/api/Controllers/Category/CreateController.php +++ b/app/modules/api/Controllers/Category/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Category; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\DataModel\CategoryData; @@ -43,7 +43,7 @@ final class CreateController extends CategoryBase public function createAction(): void { try { - $this->setupApi(ActionsInterface::CATEGORY_CREATE); + $this->setupApi(AclActionsInterface::CATEGORY_CREATE); $categoryData = $this->buildCategoryData(); diff --git a/app/modules/api/Controllers/Category/DeleteController.php b/app/modules/api/Controllers/Category/DeleteController.php index 11729fe5..71c5f454 100644 --- a/app/modules/api/Controllers/Category/DeleteController.php +++ b/app/modules/api/Controllers/Category/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Category; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Api\Services\ApiResponse; @@ -42,7 +42,7 @@ final class DeleteController extends CategoryBase public function deleteAction(): void { try { - $this->setupApi(ActionsInterface::CATEGORY_DELETE); + $this->setupApi(AclActionsInterface::CATEGORY_DELETE); $id = $this->apiService->getParamInt('id', true); diff --git a/app/modules/api/Controllers/Category/EditController.php b/app/modules/api/Controllers/Category/EditController.php index d88c2953..bdd469e7 100644 --- a/app/modules/api/Controllers/Category/EditController.php +++ b/app/modules/api/Controllers/Category/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Category; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\DataModel\CategoryData; @@ -40,7 +40,7 @@ final class EditController extends CategoryBase public function editAction(): void { try { - $this->setupApi(ActionsInterface::CATEGORY_EDIT); + $this->setupApi(AclActionsInterface::CATEGORY_EDIT); $categoryData = $this->buildCategoryData(); diff --git a/app/modules/api/Controllers/Category/SearchController.php b/app/modules/api/Controllers/Category/SearchController.php index 3ee363b1..5763732b 100644 --- a/app/modules/api/Controllers/Category/SearchController.php +++ b/app/modules/api/Controllers/Category/SearchController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Category; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\DataModel\ItemSearchData; use SP\Domain\Api\Services\ApiResponse; @@ -42,7 +42,7 @@ final class SearchController extends CategoryBase public function searchAction(): void { try { - $this->setupApi(ActionsInterface::CATEGORY_SEARCH); + $this->setupApi(AclActionsInterface::CATEGORY_SEARCH); $itemSearchData = $this->buildSearchData(); diff --git a/app/modules/api/Controllers/Category/ViewController.php b/app/modules/api/Controllers/Category/ViewController.php index cea7a4e8..4c9579af 100644 --- a/app/modules/api/Controllers/Category/ViewController.php +++ b/app/modules/api/Controllers/Category/ViewController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Category; use Exception; use League\Fractal\Resource\Item; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Api\Services\ApiResponse; @@ -46,7 +46,7 @@ final class ViewController extends CategoryBase public function viewAction(): void { try { - $this->setupApi(ActionsInterface::CATEGORY_VIEW); + $this->setupApi(AclActionsInterface::CATEGORY_VIEW); $id = $this->apiService->getParamInt('id', true); $customFields = Util::boolval($this->apiService->getParamString('customFields')); diff --git a/app/modules/api/Controllers/Client/CreateController.php b/app/modules/api/Controllers/Client/CreateController.php index 70dbf03c..87b226ec 100644 --- a/app/modules/api/Controllers/Client/CreateController.php +++ b/app/modules/api/Controllers/Client/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Client; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\DataModel\ClientData; @@ -43,7 +43,7 @@ final class CreateController extends ClientBase public function createAction(): void { try { - $this->setupApi(ActionsInterface::CLIENT_CREATE); + $this->setupApi(AclActionsInterface::CLIENT_CREATE); $clientData = $this->buildClientData(); diff --git a/app/modules/api/Controllers/Client/DeleteController.php b/app/modules/api/Controllers/Client/DeleteController.php index f054daf7..05c6028e 100644 --- a/app/modules/api/Controllers/Client/DeleteController.php +++ b/app/modules/api/Controllers/Client/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Client; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Api\Services\ApiResponse; @@ -42,7 +42,7 @@ final class DeleteController extends ClientBase public function deleteAction(): void { try { - $this->setupApi(ActionsInterface::CLIENT_DELETE); + $this->setupApi(AclActionsInterface::CLIENT_DELETE); $id = $this->apiService->getParamInt('id', true); diff --git a/app/modules/api/Controllers/Client/EditController.php b/app/modules/api/Controllers/Client/EditController.php index 35b9a35b..7ac7ba0a 100644 --- a/app/modules/api/Controllers/Client/EditController.php +++ b/app/modules/api/Controllers/Client/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Client; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\DataModel\ClientData; @@ -43,7 +43,7 @@ final class EditController extends ClientBase public function editAction(): void { try { - $this->setupApi(ActionsInterface::CLIENT_EDIT); + $this->setupApi(AclActionsInterface::CLIENT_EDIT); $clientData = $this->buildClientData(); diff --git a/app/modules/api/Controllers/Client/SearchController.php b/app/modules/api/Controllers/Client/SearchController.php index ddf30e39..6565e4f7 100644 --- a/app/modules/api/Controllers/Client/SearchController.php +++ b/app/modules/api/Controllers/Client/SearchController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Client; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\DataModel\ItemSearchData; use SP\Domain\Api\Services\ApiResponse; @@ -42,7 +42,7 @@ final class SearchController extends ClientBase public function searchAction(): void { try { - $this->setupApi(ActionsInterface::CLIENT_SEARCH); + $this->setupApi(AclActionsInterface::CLIENT_SEARCH); $itemSearchData = $this->buildSearchData(); diff --git a/app/modules/api/Controllers/Client/ViewController.php b/app/modules/api/Controllers/Client/ViewController.php index e530b427..1e32dbb6 100644 --- a/app/modules/api/Controllers/Client/ViewController.php +++ b/app/modules/api/Controllers/Client/ViewController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Client; use Exception; use League\Fractal\Resource\Item; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Api\Services\ApiResponse; @@ -43,7 +43,7 @@ final class ViewController extends ClientBase public function viewAction(): void { try { - $this->setupApi(ActionsInterface::CLIENT_VIEW); + $this->setupApi(AclActionsInterface::CLIENT_VIEW); $id = $this->apiService->getParamInt('id', true); diff --git a/app/modules/api/Controllers/Config/BackupController.php b/app/modules/api/Controllers/Config/BackupController.php index 02ede47b..f80d297f 100644 --- a/app/modules/api/Controllers/Config/BackupController.php +++ b/app/modules/api/Controllers/Config/BackupController.php @@ -27,7 +27,7 @@ namespace SP\Modules\Api\Controllers\Config; use Exception; use Klein\Klein; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -70,7 +70,7 @@ final class BackupController extends ControllerBase public function backupAction(): void { try { - $this->setupApi(ActionsInterface::CONFIG_BACKUP_RUN); + $this->setupApi(AclActionsInterface::CONFIG_BACKUP_RUN); $path = $this->apiService->getParamString('path', false, BACKUP_PATH); diff --git a/app/modules/api/Controllers/Config/ExportController.php b/app/modules/api/Controllers/Config/ExportController.php index f6bebef1..198837a0 100644 --- a/app/modules/api/Controllers/Config/ExportController.php +++ b/app/modules/api/Controllers/Config/ExportController.php @@ -28,7 +28,7 @@ namespace SP\Modules\Api\Controllers\Config; use Exception; use Klein\Klein; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -68,7 +68,7 @@ final class ExportController extends ControllerBase public function exportAction(): void { try { - $this->setupApi(ActionsInterface::CONFIG_EXPORT_RUN); + $this->setupApi(AclActionsInterface::CONFIG_EXPORT_RUN); $password = $this->apiService->getParamString('password'); $path = $this->apiService->getParamString('path', false, BACKUP_PATH); diff --git a/app/modules/api/Controllers/Tag/CreateController.php b/app/modules/api/Controllers/Tag/CreateController.php index 3cba14cb..b1121374 100644 --- a/app/modules/api/Controllers/Tag/CreateController.php +++ b/app/modules/api/Controllers/Tag/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Tag; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\DataModel\TagData; @@ -43,7 +43,7 @@ final class CreateController extends TagBase public function createAction(): void { try { - $this->setupApi(ActionsInterface::TAG_CREATE); + $this->setupApi(AclActionsInterface::TAG_CREATE); $tagData = $this->buildTagData(); diff --git a/app/modules/api/Controllers/Tag/DeleteController.php b/app/modules/api/Controllers/Tag/DeleteController.php index 18b8a508..b217cf09 100644 --- a/app/modules/api/Controllers/Tag/DeleteController.php +++ b/app/modules/api/Controllers/Tag/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Tag; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Api\Services\ApiResponse; @@ -42,7 +42,7 @@ final class DeleteController extends TagBase public function deleteAction(): void { try { - $this->setupApi(ActionsInterface::TAG_DELETE); + $this->setupApi(AclActionsInterface::TAG_DELETE); $id = $this->apiService->getParamInt('id', true); diff --git a/app/modules/api/Controllers/Tag/EditController.php b/app/modules/api/Controllers/Tag/EditController.php index d007713c..db1a6aed 100644 --- a/app/modules/api/Controllers/Tag/EditController.php +++ b/app/modules/api/Controllers/Tag/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Tag; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\DataModel\TagData; @@ -43,7 +43,7 @@ final class EditController extends TagBase public function editAction(): void { try { - $this->setupApi(ActionsInterface::TAG_EDIT); + $this->setupApi(AclActionsInterface::TAG_EDIT); $tagData = $this->buildTagData(); diff --git a/app/modules/api/Controllers/Tag/SearchController.php b/app/modules/api/Controllers/Tag/SearchController.php index af4b846e..ab5b5798 100644 --- a/app/modules/api/Controllers/Tag/SearchController.php +++ b/app/modules/api/Controllers/Tag/SearchController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\Tag; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\DataModel\ItemSearchData; use SP\Domain\Api\Services\ApiResponse; @@ -42,7 +42,7 @@ final class SearchController extends TagBase public function searchAction(): void { try { - $this->setupApi(ActionsInterface::TAG_SEARCH); + $this->setupApi(AclActionsInterface::TAG_SEARCH); $itemSearchData = $this->buildSearchData(); diff --git a/app/modules/api/Controllers/Tag/ViewController.php b/app/modules/api/Controllers/Tag/ViewController.php index 9547bf98..045d0e56 100644 --- a/app/modules/api/Controllers/Tag/ViewController.php +++ b/app/modules/api/Controllers/Tag/ViewController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Api\Controllers\Tag; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Api\Services\ApiResponse; @@ -43,7 +43,7 @@ final class ViewController extends TagBase public function viewAction(): void { try { - $this->setupApi(ActionsInterface::TAG_VIEW); + $this->setupApi(AclActionsInterface::TAG_VIEW); $id = $this->apiService->getParamInt('id', true); $tagData = $this->tagService->getById($id); diff --git a/app/modules/api/Controllers/UserGroup/CreateController.php b/app/modules/api/Controllers/UserGroup/CreateController.php index 244d1233..6b138281 100644 --- a/app/modules/api/Controllers/UserGroup/CreateController.php +++ b/app/modules/api/Controllers/UserGroup/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\UserGroup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\DataModel\UserGroupData; @@ -43,7 +43,7 @@ final class CreateController extends UserGroupBase public function createAction(): void { try { - $this->setupApi(ActionsInterface::GROUP_CREATE); + $this->setupApi(AclActionsInterface::GROUP_CREATE); $userGroupData = $this->buildUserGroupData(); diff --git a/app/modules/api/Controllers/UserGroup/DeleteController.php b/app/modules/api/Controllers/UserGroup/DeleteController.php index fcf5d429..cc3356e2 100644 --- a/app/modules/api/Controllers/UserGroup/DeleteController.php +++ b/app/modules/api/Controllers/UserGroup/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\UserGroup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Api\Services\ApiResponse; @@ -42,7 +42,7 @@ final class DeleteController extends UserGroupBase public function deleteAction(): void { try { - $this->setupApi(ActionsInterface::GROUP_DELETE); + $this->setupApi(AclActionsInterface::GROUP_DELETE); $id = $this->apiService->getParamInt('id', true); diff --git a/app/modules/api/Controllers/UserGroup/EditController.php b/app/modules/api/Controllers/UserGroup/EditController.php index 89d6ac5c..8445d4a7 100644 --- a/app/modules/api/Controllers/UserGroup/EditController.php +++ b/app/modules/api/Controllers/UserGroup/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\UserGroup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\DataModel\UserGroupData; @@ -43,7 +43,7 @@ final class EditController extends UserGroupBase public function editAction(): void { try { - $this->setupApi(ActionsInterface::GROUP_EDIT); + $this->setupApi(AclActionsInterface::GROUP_EDIT); $userGroupData = $this->buildUserGroupData(); diff --git a/app/modules/api/Controllers/UserGroup/SearchController.php b/app/modules/api/Controllers/UserGroup/SearchController.php index 01668f47..a20ed57c 100644 --- a/app/modules/api/Controllers/UserGroup/SearchController.php +++ b/app/modules/api/Controllers/UserGroup/SearchController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Api\Controllers\UserGroup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\DataModel\ItemSearchData; use SP\Domain\Api\Services\ApiResponse; @@ -42,7 +42,7 @@ final class SearchController extends UserGroupBase public function searchAction(): void { try { - $this->setupApi(ActionsInterface::GROUP_SEARCH); + $this->setupApi(AclActionsInterface::GROUP_SEARCH); $itemSearchData = $this->buildSearchData(); diff --git a/app/modules/api/Controllers/UserGroup/ViewController.php b/app/modules/api/Controllers/UserGroup/ViewController.php index ed238b37..4e61609d 100644 --- a/app/modules/api/Controllers/UserGroup/ViewController.php +++ b/app/modules/api/Controllers/UserGroup/ViewController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Api\Controllers\UserGroup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Domain\Api\Services\ApiResponse; @@ -43,7 +43,7 @@ final class ViewController extends UserGroupBase public function viewAction(): void { try { - $this->setupApi(ActionsInterface::GROUP_VIEW); + $this->setupApi(AclActionsInterface::GROUP_VIEW); $id = $this->apiService->getParamInt('id', true); $userGroupData = $this->userGroupService->getById($id); diff --git a/app/modules/web/Controllers/AccessManager/IndexController.php b/app/modules/web/Controllers/AccessManager/IndexController.php index eb2365f4..a83c0095 100644 --- a/app/modules/web/Controllers/AccessManager/IndexController.php +++ b/app/modules/web/Controllers/AccessManager/IndexController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\AccessManager; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\Exceptions\ConstraintException; @@ -118,24 +118,24 @@ final class IndexController extends ControllerBase { $this->itemSearchData->setLimitCount($this->configData->getAccountCount()); - if ($this->checkAccess(ActionsInterface::USER)) { + if ($this->checkAccess(AclActionsInterface::USER)) { $this->tabsGridHelper->addTab($this->getUsersList()); } - if ($this->checkAccess(ActionsInterface::GROUP)) { + if ($this->checkAccess(AclActionsInterface::GROUP)) { $this->tabsGridHelper->addTab($this->getUsersGroupList()); } - if ($this->checkAccess(ActionsInterface::PROFILE)) { + if ($this->checkAccess(AclActionsInterface::PROFILE)) { $this->tabsGridHelper->addTab($this->getUsersProfileList()); } - if ($this->checkAccess(ActionsInterface::AUTHTOKEN)) { + if ($this->checkAccess(AclActionsInterface::AUTHTOKEN)) { $this->tabsGridHelper->addTab($this->getAuthTokensList()); } if ($this->configData->isPublinksEnabled() - && $this->checkAccess(ActionsInterface::PUBLICLINK)) { + && $this->checkAccess(AclActionsInterface::PUBLICLINK)) { $this->tabsGridHelper->addTab($this->getPublicLinksList()); } @@ -145,7 +145,7 @@ final class IndexController extends ControllerBase ); $this->tabsGridHelper->renderTabs( - Acl::getActionRoute(ActionsInterface::ACCESS_MANAGE), + Acl::getActionRoute(AclActionsInterface::ACCESS_MANAGE), $this->request->analyzeInt('tabIndex', 0) ); diff --git a/app/modules/web/Controllers/Account/CopyController.php b/app/modules/web/Controllers/Account/CopyController.php index ce95867a..985ad10c 100644 --- a/app/modules/web/Controllers/Account/CopyController.php +++ b/app/modules/web/Controllers/Account/CopyController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Util\ErrorUtil; @@ -47,7 +47,7 @@ final class CopyController extends AccountViewBase $accountEnrichedDto = $this->accountService->withUserGroups($accountEnrichedDto); $accountEnrichedDto = $this->accountService->withTags($accountEnrichedDto); - $this->accountHelper->setViewForAccount($accountEnrichedDto, ActionsInterface::ACCOUNT_COPY); + $this->accountHelper->setViewForAccount($accountEnrichedDto, AclActionsInterface::ACCOUNT_COPY); $this->view->addTemplate('account'); $this->view->assign( diff --git a/app/modules/web/Controllers/Account/CreateController.php b/app/modules/web/Controllers/Account/CreateController.php index 937b3206..b4b0be03 100644 --- a/app/modules/web/Controllers/Account/CreateController.php +++ b/app/modules/web/Controllers/Account/CreateController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Util\ErrorUtil; @@ -40,7 +40,7 @@ final class CreateController extends AccountViewBase public function createAction(): void { try { - $this->accountHelper->setViewForBlank(ActionsInterface::ACCOUNT_CREATE); + $this->accountHelper->setViewForBlank(AclActionsInterface::ACCOUNT_CREATE); $this->view->addTemplate('account'); $this->view->assign( diff --git a/app/modules/web/Controllers/Account/DeleteController.php b/app/modules/web/Controllers/Account/DeleteController.php index ad05c023..7186452e 100644 --- a/app/modules/web/Controllers/Account/DeleteController.php +++ b/app/modules/web/Controllers/Account/DeleteController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\UI\ThemeIcons; @@ -72,7 +72,7 @@ final class DeleteController extends AccountControllerBase $accountEnrichedDto = $this->accountService->withUserGroups($accountEnrichedDto); $accountEnrichedDto = $this->accountService->withTags($accountEnrichedDto); - $this->accountHelper->setViewForAccount($accountEnrichedDto, ActionsInterface::ACCOUNT_DELETE); + $this->accountHelper->setViewForAccount($accountEnrichedDto, AclActionsInterface::ACCOUNT_DELETE); $this->view->addTemplate('account'); $this->view->assign( diff --git a/app/modules/web/Controllers/Account/EditController.php b/app/modules/web/Controllers/Account/EditController.php index 18a5d83b..81404317 100644 --- a/app/modules/web/Controllers/Account/EditController.php +++ b/app/modules/web/Controllers/Account/EditController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Util\ErrorUtil; @@ -48,7 +48,7 @@ final class EditController extends AccountViewBase $accountEnrichedDto = $this->accountService->withUserGroups($accountEnrichedDto); $accountEnrichedDto = $this->accountService->withTags($accountEnrichedDto); - $this->accountHelper->setViewForAccount($accountEnrichedDto, ActionsInterface::ACCOUNT_EDIT); + $this->accountHelper->setViewForAccount($accountEnrichedDto, AclActionsInterface::ACCOUNT_EDIT); $this->view->addTemplate('account'); $this->view->assign( diff --git a/app/modules/web/Controllers/Account/EditPassController.php b/app/modules/web/Controllers/Account/EditPassController.php index 753b8a7b..5b740c20 100644 --- a/app/modules/web/Controllers/Account/EditPassController.php +++ b/app/modules/web/Controllers/Account/EditPassController.php @@ -27,7 +27,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Util\ErrorUtil; @@ -51,7 +51,7 @@ final class EditPassController extends AccountViewBase $accountEnrichedDto = $this->accountService->withUsers($accountEnrichedDto); $accountEnrichedDto = $this->accountService->withUserGroups($accountEnrichedDto); - $this->accountHelper->setViewForAccount($accountEnrichedDto, ActionsInterface::ACCOUNT_EDIT_PASS); + $this->accountHelper->setViewForAccount($accountEnrichedDto, AclActionsInterface::ACCOUNT_EDIT_PASS); $this->view->addTemplate('account-editpass'); $this->view->assign( diff --git a/app/modules/web/Controllers/Account/RequestAccessController.php b/app/modules/web/Controllers/Account/RequestAccessController.php index b2a0f169..52a7e2b1 100644 --- a/app/modules/web/Controllers/Account/RequestAccessController.php +++ b/app/modules/web/Controllers/Account/RequestAccessController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Domain\Account\Ports\AccountServiceInterface; @@ -66,7 +66,7 @@ final class RequestAccessController extends ControllerBase $this->accountRequestHelper->setIsView(true); $this->accountRequestHelper->setViewForRequest( $this->accountService->getByIdEnriched($id), - ActionsInterface::ACCOUNT_REQUEST + AclActionsInterface::ACCOUNT_REQUEST ); $this->view->addTemplate('account-request'); diff --git a/app/modules/web/Controllers/Account/SaveCopyController.php b/app/modules/web/Controllers/Account/SaveCopyController.php index 6f5ff549..d9a1c641 100644 --- a/app/modules/web/Controllers/Account/SaveCopyController.php +++ b/app/modules/web/Controllers/Account/SaveCopyController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -44,7 +44,7 @@ final class SaveCopyController extends AccountSaveBase public function saveCopyAction(): ?bool { try { - $this->accountForm->validateFor(ActionsInterface::ACCOUNT_CREATE); + $this->accountForm->validateFor(AclActionsInterface::ACCOUNT_CREATE); $accountId = $this->accountService->create($this->accountForm->getItemData()); @@ -61,7 +61,7 @@ final class SaveCopyController extends AccountSaveBase ); $this->addCustomFieldsForItem( - ActionsInterface::ACCOUNT, + AclActionsInterface::ACCOUNT, $accountId, $this->request, $this->customFieldService @@ -70,7 +70,7 @@ final class SaveCopyController extends AccountSaveBase return $this->returnJsonResponseData( [ 'itemId' => $accountId, - 'nextAction' => Acl::getActionRoute(ActionsInterface::ACCOUNT_EDIT), + 'nextAction' => Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT), ], JsonResponse::JSON_SUCCESS, __u('Account created') diff --git a/app/modules/web/Controllers/Account/SaveCreateController.php b/app/modules/web/Controllers/Account/SaveCreateController.php index a17b3902..60ae4012 100644 --- a/app/modules/web/Controllers/Account/SaveCreateController.php +++ b/app/modules/web/Controllers/Account/SaveCreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -44,7 +44,7 @@ final class SaveCreateController extends AccountSaveBase public function saveCreateAction(): ?bool { try { - $this->accountForm->validateFor(ActionsInterface::ACCOUNT_CREATE); + $this->accountForm->validateFor(AclActionsInterface::ACCOUNT_CREATE); $accountId = $this->accountService->create($this->accountForm->getItemData()); @@ -61,7 +61,7 @@ final class SaveCreateController extends AccountSaveBase ); $this->addCustomFieldsForItem( - ActionsInterface::ACCOUNT, + AclActionsInterface::ACCOUNT, $accountId, $this->request, $this->customFieldService @@ -70,7 +70,7 @@ final class SaveCreateController extends AccountSaveBase return $this->returnJsonResponseData( [ 'itemId' => $accountId, - 'nextAction' => Acl::getActionRoute(ActionsInterface::ACCOUNT_EDIT), + 'nextAction' => Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT), ], JsonResponse::JSON_SUCCESS, __u('Account created') diff --git a/app/modules/web/Controllers/Account/SaveDeleteController.php b/app/modules/web/Controllers/Account/SaveDeleteController.php index 15f693e4..788fbbcc 100644 --- a/app/modules/web/Controllers/Account/SaveDeleteController.php +++ b/app/modules/web/Controllers/Account/SaveDeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -86,7 +86,7 @@ final class SaveDeleteController extends AccountControllerBase ) ); - $this->deleteCustomFieldsForItem(ActionsInterface::ACCOUNT, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::ACCOUNT, $id, $this->customFieldService); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Account removed')); } catch (Exception $e) { diff --git a/app/modules/web/Controllers/Account/SaveEditController.php b/app/modules/web/Controllers/Account/SaveEditController.php index 2e28b1e3..fb86dacc 100644 --- a/app/modules/web/Controllers/Account/SaveEditController.php +++ b/app/modules/web/Controllers/Account/SaveEditController.php @@ -27,7 +27,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -49,7 +49,7 @@ final class SaveEditController extends AccountSaveBase public function saveEditAction(int $id): ?bool { try { - $this->accountForm->validateFor(ActionsInterface::ACCOUNT_EDIT, $id); + $this->accountForm->validateFor(AclActionsInterface::ACCOUNT_EDIT, $id); $itemData = $this->accountForm->getItemData(); @@ -68,7 +68,7 @@ final class SaveEditController extends AccountSaveBase ); $this->updateCustomFieldsForItem( - ActionsInterface::ACCOUNT, + AclActionsInterface::ACCOUNT, $id, $this->request, $this->customFieldService @@ -77,7 +77,7 @@ final class SaveEditController extends AccountSaveBase return $this->returnJsonResponseData( [ 'itemId' => $id, - 'nextAction' => Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW), + 'nextAction' => Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW), ], JsonResponse::JSON_SUCCESS, __u('Account updated') diff --git a/app/modules/web/Controllers/Account/SaveEditPassController.php b/app/modules/web/Controllers/Account/SaveEditPassController.php index 08751984..21361b77 100644 --- a/app/modules/web/Controllers/Account/SaveEditPassController.php +++ b/app/modules/web/Controllers/Account/SaveEditPassController.php @@ -27,7 +27,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -73,7 +73,7 @@ final class SaveEditPassController extends AccountControllerBase public function saveEditPassAction(int $id): bool { try { - $this->accountForm->validateFor(ActionsInterface::ACCOUNT_EDIT_PASS, $id); + $this->accountForm->validateFor(AclActionsInterface::ACCOUNT_EDIT_PASS, $id); $this->accountService->editPassword($this->accountForm->getItemData()); @@ -92,7 +92,7 @@ final class SaveEditPassController extends AccountControllerBase return $this->returnJsonResponseData( [ 'itemId' => $id, - 'nextAction' => Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW), + 'nextAction' => Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW), ], JsonResponse::JSON_SUCCESS, __u('Password updated') diff --git a/app/modules/web/Controllers/Account/SaveEditRestoreController.php b/app/modules/web/Controllers/Account/SaveEditRestoreController.php index ea964692..9544d95e 100644 --- a/app/modules/web/Controllers/Account/SaveEditRestoreController.php +++ b/app/modules/web/Controllers/Account/SaveEditRestoreController.php @@ -27,7 +27,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -87,7 +87,7 @@ final class SaveEditRestoreController extends AccountControllerBase return $this->returnJsonResponseData( [ 'itemId' => $id, - 'nextAction' => Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW), + 'nextAction' => Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW), ], JsonResponse::JSON_SUCCESS, __u('Account restored') diff --git a/app/modules/web/Controllers/Account/SaveRequestController.php b/app/modules/web/Controllers/Account/SaveRequestController.php index 88fc1648..c1e05f3a 100644 --- a/app/modules/web/Controllers/Account/SaveRequestController.php +++ b/app/modules/web/Controllers/Account/SaveRequestController.php @@ -27,7 +27,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Bootstrap\BootstrapBase; use SP\Core\Events\Event; @@ -88,7 +88,7 @@ final class SaveRequestController extends AccountControllerBase $baseUrl = ($this->configData->getApplicationUrl() ?: BootstrapBase::$WEBURI).BootstrapBase::$SUBURI; $deepLink = new Uri($baseUrl); - $deepLink->addParam('r', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW).'/'.$id); + $deepLink->addParam('r', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW) . '/' . $id); $usersId = [$accountDetails->userId, $accountDetails->userEditId]; @@ -121,7 +121,7 @@ final class SaveRequestController extends AccountControllerBase return $this->returnJsonResponseData( [ 'itemId' => $id, - 'nextAction' => Acl::getActionRoute(ActionsInterface::ACCOUNT), + 'nextAction' => Acl::getActionRoute(AclActionsInterface::ACCOUNT), ], JsonResponse::JSON_SUCCESS, __u('Request done') diff --git a/app/modules/web/Controllers/Account/ViewController.php b/app/modules/web/Controllers/Account/ViewController.php index c33fa9fe..be8efaf5 100644 --- a/app/modules/web/Controllers/Account/ViewController.php +++ b/app/modules/web/Controllers/Account/ViewController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Util\ErrorUtil; @@ -53,7 +53,7 @@ final class ViewController extends AccountViewBase ->withTagsById($accountDetailsResponse); $this->accountHelper->setIsView(true); - $this->accountHelper->setViewForAccount($accountDetailsResponse, ActionsInterface::ACCOUNT_VIEW); + $this->accountHelper->setViewForAccount($accountDetailsResponse, AclActionsInterface::ACCOUNT_VIEW); $this->view->assign( 'title', diff --git a/app/modules/web/Controllers/Account/ViewHistoryController.php b/app/modules/web/Controllers/Account/ViewHistoryController.php index 28d8b087..da1736c9 100644 --- a/app/modules/web/Controllers/Account/ViewHistoryController.php +++ b/app/modules/web/Controllers/Account/ViewHistoryController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Modules\Web\Controllers\Helpers\Account\AccountHistoryHelper; @@ -65,7 +65,7 @@ final class ViewHistoryController extends AccountControllerBase try { $accountHistoryData = $this->accountHistoryService->getById($id); - $this->accountHistoryHelper->setView($accountHistoryData, ActionsInterface::ACCOUNT_HISTORY_VIEW); + $this->accountHistoryHelper->setView($accountHistoryData, AclActionsInterface::ACCOUNT_HISTORY_VIEW); $this->view->addTemplate('account-history'); diff --git a/app/modules/web/Controllers/Account/ViewLinkController.php b/app/modules/web/Controllers/Account/ViewLinkController.php index b631f563..1d8f338a 100644 --- a/app/modules/web/Controllers/Account/ViewLinkController.php +++ b/app/modules/web/Controllers/Account/ViewLinkController.php @@ -27,7 +27,7 @@ namespace SP\Modules\Web\Controllers\Account; use Exception; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Bootstrap\BootstrapBase; use SP\Core\Crypt\Vault; @@ -125,7 +125,7 @@ final class ViewLinkController extends AccountControllerBase } else { $this->view->assign( 'copyPassRoute', - Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW_PASS) + Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW_PASS) ); } @@ -138,7 +138,7 @@ final class ViewLinkController extends AccountControllerBase $baseUrl = ($this->configData->getApplicationUrl() ?: BootstrapBase::$WEBURI).BootstrapBase::$SUBURI; $deepLink = new Uri($baseUrl); - $deepLink->addParam('r', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW).'/'.$accountData->getId()); + $deepLink->addParam('r', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW) . '/' . $accountData->getId()); $this->eventDispatcher->notify( 'show.account.link', diff --git a/app/modules/web/Controllers/AccountFile/ListController.php b/app/modules/web/Controllers/AccountFile/ListController.php index 37c03533..f2304e94 100644 --- a/app/modules/web/Controllers/AccountFile/ListController.php +++ b/app/modules/web/Controllers/AccountFile/ListController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\AccountFile; use Exception; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Util\ErrorUtil; @@ -55,9 +55,9 @@ final class ListController extends AccountFileBase $this->view->assign('deleteEnabled', $this->request->analyzeInt('del', false)); $this->view->assign('files', $this->accountFileService->getByAccountId($accountId)); - $this->view->assign('fileViewRoute', Acl::getActionRoute(ActionsInterface::ACCOUNT_FILE_VIEW)); - $this->view->assign('fileDownloadRoute', Acl::getActionRoute(ActionsInterface::ACCOUNT_FILE_DOWNLOAD)); - $this->view->assign('fileDeleteRoute', Acl::getActionRoute(ActionsInterface::ACCOUNT_FILE_DELETE)); + $this->view->assign('fileViewRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FILE_VIEW)); + $this->view->assign('fileDownloadRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FILE_DOWNLOAD)); + $this->view->assign('fileDeleteRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FILE_DELETE)); if (!is_array($this->view->files) || count($this->view->files) === 0) { diff --git a/app/modules/web/Controllers/AccountFile/SearchController.php b/app/modules/web/Controllers/AccountFile/SearchController.php index 020738bd..8af76c2e 100644 --- a/app/modules/web/Controllers/AccountFile/SearchController.php +++ b/app/modules/web/Controllers/AccountFile/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Controllers\AccountFile; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Domain\Account\Ports\AccountFileServiceInterface; use SP\Html\DataGrid\DataGridInterface; @@ -71,7 +71,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::ACCOUNT_FILE_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::ACCOUNT_FILE_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/AccountHistoryManager/SearchController.php b/app/modules/web/Controllers/AccountHistoryManager/SearchController.php index 5cb9f436..8ed63454 100644 --- a/app/modules/web/Controllers/AccountHistoryManager/SearchController.php +++ b/app/modules/web/Controllers/AccountHistoryManager/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Controllers\AccountHistoryManager; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -73,7 +73,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::ACCOUNTMGR_HISTORY_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::ACCOUNTMGR_HISTORY_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/AccountManager/BulkEditController.php b/app/modules/web/Controllers/AccountManager/BulkEditController.php index 3eddb64d..1fa256e1 100644 --- a/app/modules/web/Controllers/AccountManager/BulkEditController.php +++ b/app/modules/web/Controllers/AccountManager/BulkEditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\AccountManager; use Exception; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Domain\Account\Ports\AccountHistoryServiceInterface; @@ -95,7 +95,7 @@ final class BulkEditController extends ControllerBase public function bulkEditAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::ACCOUNTMGR)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::ACCOUNTMGR)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') @@ -129,7 +129,7 @@ final class BulkEditController extends ControllerBase { $this->view->addTemplate('account_bulkedit', 'itemshow'); - $this->view->assign('nextAction', Acl::getActionRoute(ActionsInterface::ITEMS_MANAGE)); + $this->view->assign('nextAction', Acl::getActionRoute(AclActionsInterface::ITEMS_MANAGE)); $clients = SelectItemAdapter::factory($this->clientService->getAllBasic())->getItemsFromModel(); $categories = SelectItemAdapter::factory($this->categoryService->getAllBasic())->getItemsFromModel(); diff --git a/app/modules/web/Controllers/AccountManager/DeleteController.php b/app/modules/web/Controllers/AccountManager/DeleteController.php index 89656ee0..b5d26622 100644 --- a/app/modules/web/Controllers/AccountManager/DeleteController.php +++ b/app/modules/web/Controllers/AccountManager/DeleteController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\AccountManager; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -77,7 +77,7 @@ final class DeleteController extends ControllerBase if ($id === null) { $this->accountService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->deleteCustomFieldsForItem(ActionsInterface::ACCOUNT, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::ACCOUNT, $id, $this->customFieldService); $this->eventDispatcher->notify( 'delete.account.selection', @@ -91,7 +91,7 @@ final class DeleteController extends ControllerBase $this->accountService->delete($id); - $this->deleteCustomFieldsForItem(ActionsInterface::ACCOUNT, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::ACCOUNT, $id, $this->customFieldService); $this->eventDispatcher->notify( 'delete.account', diff --git a/app/modules/web/Controllers/AccountManager/SaveBulkEditController.php b/app/modules/web/Controllers/AccountManager/SaveBulkEditController.php index cd8fbc1d..77d6b0b3 100644 --- a/app/modules/web/Controllers/AccountManager/SaveBulkEditController.php +++ b/app/modules/web/Controllers/AccountManager/SaveBulkEditController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\AccountManager; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -84,7 +84,7 @@ final class SaveBulkEditController extends ControllerBase $accountBulkDto = new AccountUpdateBulkDto( array_map(function ($itemId) { - $this->accountForm->validateFor(ActionsInterface::ACCOUNTMGR_BULK_EDIT, $itemId); + $this->accountForm->validateFor(AclActionsInterface::ACCOUNTMGR_BULK_EDIT, $itemId); return $this->accountForm->getItemData(); }, $itemsId) diff --git a/app/modules/web/Controllers/AccountManager/SearchController.php b/app/modules/web/Controllers/AccountManager/SearchController.php index 78b339f6..83ff99ac 100644 --- a/app/modules/web/Controllers/AccountManager/SearchController.php +++ b/app/modules/web/Controllers/AccountManager/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Controllers\AccountManager; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Domain\Account\Ports\AccountSearchServiceInterface; use SP\Domain\Account\Ports\AccountServiceInterface; @@ -77,7 +77,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::ACCOUNTMGR_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::ACCOUNTMGR_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/AuthToken/AuthTokenViewBase.php b/app/modules/web/Controllers/AuthToken/AuthTokenViewBase.php index 20049281..a64a89a6 100644 --- a/app/modules/web/Controllers/AuthToken/AuthTokenViewBase.php +++ b/app/modules/web/Controllers/AuthToken/AuthTokenViewBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\AuthToken; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -100,7 +100,7 @@ abstract class AuthTokenViewBase extends ControllerBase $this->view->assign( 'nextAction', - Acl::getActionRoute(ActionsInterface::ACCESS_MANAGE) + Acl::getActionRoute(AclActionsInterface::ACCESS_MANAGE) ); if ($this->view->isView === true) { @@ -113,7 +113,7 @@ abstract class AuthTokenViewBase extends ControllerBase $this->view->assign( 'customFields', - $this->getCustomFieldsForItem(ActionsInterface::AUTHTOKEN, $authTokenId, $this->customFieldService) + $this->getCustomFieldsForItem(AclActionsInterface::AUTHTOKEN, $authTokenId, $this->customFieldService) ); } } diff --git a/app/modules/web/Controllers/AuthToken/CreateController.php b/app/modules/web/Controllers/AuthToken/CreateController.php index b219d101..a3883520 100644 --- a/app/modules/web/Controllers/AuthToken/CreateController.php +++ b/app/modules/web/Controllers/AuthToken/CreateController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\AuthToken; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; @@ -43,7 +43,7 @@ final class CreateController extends AuthTokenViewBase public function createAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::AUTHTOKEN_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::AUTHTOKEN_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/AuthToken/DeleteController.php b/app/modules/web/Controllers/AuthToken/DeleteController.php index 9ac7c3db..4556ef5e 100644 --- a/app/modules/web/Controllers/AuthToken/DeleteController.php +++ b/app/modules/web/Controllers/AuthToken/DeleteController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\AuthToken; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -48,7 +48,7 @@ final class DeleteController extends AuthTokenSaveBase public function deleteAction(?int $id = null): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::AUTHTOKEN_DELETE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::AUTHTOKEN_DELETE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') @@ -58,7 +58,7 @@ final class DeleteController extends AuthTokenSaveBase if ($id === null) { $this->authTokenService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->deleteCustomFieldsForItem(ActionsInterface::AUTHTOKEN, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::AUTHTOKEN, $id, $this->customFieldService); $this->eventDispatcher->notify( 'delete.authToken.selection', @@ -70,7 +70,7 @@ final class DeleteController extends AuthTokenSaveBase $this->authTokenService->delete($id); - $this->deleteCustomFieldsForItem(ActionsInterface::AUTHTOKEN, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::AUTHTOKEN, $id, $this->customFieldService); $this->eventDispatcher->notify( 'delete.authToken', diff --git a/app/modules/web/Controllers/AuthToken/EditController.php b/app/modules/web/Controllers/AuthToken/EditController.php index fb4f2cf3..a13b7ca9 100644 --- a/app/modules/web/Controllers/AuthToken/EditController.php +++ b/app/modules/web/Controllers/AuthToken/EditController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\AuthToken; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; @@ -47,7 +47,7 @@ final class EditController extends AuthTokenViewBase public function editAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::AUTHTOKEN_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::AUTHTOKEN_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/AuthToken/SaveCreateController.php b/app/modules/web/Controllers/AuthToken/SaveCreateController.php index b57b772c..34b1bb66 100644 --- a/app/modules/web/Controllers/AuthToken/SaveCreateController.php +++ b/app/modules/web/Controllers/AuthToken/SaveCreateController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\AuthToken; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Exceptions\ValidationException; use SP\Http\JsonResponse; @@ -44,19 +44,19 @@ final class SaveCreateController extends AuthTokenSaveBase public function saveCreateAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::AUTHTOKEN_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::AUTHTOKEN_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::AUTHTOKEN_CREATE); + $this->form->validateFor(AclActionsInterface::AUTHTOKEN_CREATE); $id = $this->authTokenService->create($this->form->getItemData()); $this->addCustomFieldsForItem( - ActionsInterface::AUTHTOKEN, + AclActionsInterface::AUTHTOKEN, $id, $this->request, $this->customFieldService diff --git a/app/modules/web/Controllers/AuthToken/SaveEditController.php b/app/modules/web/Controllers/AuthToken/SaveEditController.php index 76f07054..93cd7fba 100644 --- a/app/modules/web/Controllers/AuthToken/SaveEditController.php +++ b/app/modules/web/Controllers/AuthToken/SaveEditController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\AuthToken; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -49,14 +49,14 @@ final class SaveEditController extends AuthTokenSaveBase public function saveEditAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::AUTHTOKEN_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::AUTHTOKEN_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::AUTHTOKEN_EDIT, $id); + $this->form->validateFor(AclActionsInterface::AUTHTOKEN_EDIT, $id); if ($this->form->isRefresh()) { $this->authTokenService->refreshAndUpdate($this->form->getItemData()); @@ -85,7 +85,7 @@ final class SaveEditController extends AuthTokenSaveBase } $this->updateCustomFieldsForItem( - ActionsInterface::AUTHTOKEN, + AclActionsInterface::AUTHTOKEN, $id, $this->request, $this->customFieldService diff --git a/app/modules/web/Controllers/AuthToken/SearchController.php b/app/modules/web/Controllers/AuthToken/SearchController.php index 28a8c1e2..de620eb8 100644 --- a/app/modules/web/Controllers/AuthToken/SearchController.php +++ b/app/modules/web/Controllers/AuthToken/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Controllers\AuthToken; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -75,7 +75,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::AUTHTOKEN_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::AUTHTOKEN_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/AuthToken/ViewController.php b/app/modules/web/Controllers/AuthToken/ViewController.php index 9da5a6c8..7d1a47a8 100644 --- a/app/modules/web/Controllers/AuthToken/ViewController.php +++ b/app/modules/web/Controllers/AuthToken/ViewController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\AuthToken; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -48,7 +48,7 @@ final class ViewController extends AuthTokenViewBase public function viewAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::AUTHTOKEN_VIEW)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::AUTHTOKEN_VIEW)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Category/CategoryViewBase.php b/app/modules/web/Controllers/Category/CategoryViewBase.php index 80304fe7..1de780f3 100644 --- a/app/modules/web/Controllers/Category/CategoryViewBase.php +++ b/app/modules/web/Controllers/Category/CategoryViewBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Category; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -84,7 +84,7 @@ abstract class CategoryViewBase extends ControllerBase $this->view->assign('category', $category); - $this->view->assign('nextAction', Acl::getActionRoute(ActionsInterface::ITEMS_MANAGE)); + $this->view->assign('nextAction', Acl::getActionRoute(AclActionsInterface::ITEMS_MANAGE)); if ($this->view->isView === true) { $this->view->assign('disabled', 'disabled'); @@ -96,11 +96,11 @@ abstract class CategoryViewBase extends ControllerBase $this->view->assign( 'showViewCustomPass', - $this->acl->checkUserAccess(ActionsInterface::CUSTOMFIELD_VIEW_PASS) + $this->acl->checkUserAccess(AclActionsInterface::CUSTOMFIELD_VIEW_PASS) ); $this->view->assign( 'customFields', - $this->getCustomFieldsForItem(ActionsInterface::CATEGORY, $categoryId, $this->customFieldService) + $this->getCustomFieldsForItem(AclActionsInterface::CATEGORY, $categoryId, $this->customFieldService) ); } } diff --git a/app/modules/web/Controllers/Category/CreateController.php b/app/modules/web/Controllers/Category/CreateController.php index 71782284..2efe0de5 100644 --- a/app/modules/web/Controllers/Category/CreateController.php +++ b/app/modules/web/Controllers/Category/CreateController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Category; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -44,7 +44,7 @@ final class CreateController extends CategoryViewBase public function createAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CATEGORY_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CATEGORY_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Category/DeleteController.php b/app/modules/web/Controllers/Category/DeleteController.php index 7e03360c..0f9f549c 100644 --- a/app/modules/web/Controllers/Category/DeleteController.php +++ b/app/modules/web/Controllers/Category/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Category; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -47,7 +47,7 @@ final class DeleteController extends CategorySaveBase public function deleteAction(?int $id = null): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CATEGORY_DELETE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CATEGORY_DELETE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') @@ -57,7 +57,7 @@ final class DeleteController extends CategorySaveBase if ($id === null) { $this->categoryService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->deleteCustomFieldsForItem(ActionsInterface::CATEGORY, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::CATEGORY, $id, $this->customFieldService); $this->eventDispatcher->notify( 'delete.category', @@ -72,7 +72,7 @@ final class DeleteController extends CategorySaveBase $this->categoryService->delete($id); - $this->deleteCustomFieldsForItem(ActionsInterface::CATEGORY, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::CATEGORY, $id, $this->customFieldService); $this->eventDispatcher->notify( 'delete.category', diff --git a/app/modules/web/Controllers/Category/EditController.php b/app/modules/web/Controllers/Category/EditController.php index f51d1a91..b1e1bbe1 100644 --- a/app/modules/web/Controllers/Category/EditController.php +++ b/app/modules/web/Controllers/Category/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Category; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -49,7 +49,7 @@ final class EditController extends CategoryViewBase public function editAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CATEGORY_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CATEGORY_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Category/SaveCreateAction.php b/app/modules/web/Controllers/Category/SaveCreateAction.php index 87522c62..72e6c8cb 100644 --- a/app/modules/web/Controllers/Category/SaveCreateAction.php +++ b/app/modules/web/Controllers/Category/SaveCreateAction.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Category; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -43,14 +43,14 @@ final class SaveCreateAction extends CategorySaveBase public function saveCreateAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CATEGORY_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CATEGORY_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::CATEGORY_CREATE); + $this->form->validateFor(AclActionsInterface::CATEGORY_CREATE); $itemData = $this->form->getItemData(); @@ -67,7 +67,7 @@ final class SaveCreateAction extends CategorySaveBase ); $this->addCustomFieldsForItem( - ActionsInterface::CATEGORY, + AclActionsInterface::CATEGORY, $id, $this->request, $this->customFieldService diff --git a/app/modules/web/Controllers/Category/SaveEditController.php b/app/modules/web/Controllers/Category/SaveEditController.php index 067b9ba9..1bf2e41e 100644 --- a/app/modules/web/Controllers/Category/SaveEditController.php +++ b/app/modules/web/Controllers/Category/SaveEditController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Category; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -47,14 +47,14 @@ final class SaveEditController extends CategorySaveBase public function saveEditAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CATEGORY_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CATEGORY_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::CATEGORY_EDIT, $id); + $this->form->validateFor(AclActionsInterface::CATEGORY_EDIT, $id); $itemData = $this->form->getItemData(); @@ -71,7 +71,7 @@ final class SaveEditController extends CategorySaveBase ); $this->updateCustomFieldsForItem( - ActionsInterface::CATEGORY, + AclActionsInterface::CATEGORY, $id, $this->request, $this->customFieldService diff --git a/app/modules/web/Controllers/Category/SearchController.php b/app/modules/web/Controllers/Category/SearchController.php index baed3880..17cbe745 100644 --- a/app/modules/web/Controllers/Category/SearchController.php +++ b/app/modules/web/Controllers/Category/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Category; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -74,7 +74,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::CATEGORY_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CATEGORY_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Category/ViewController.php b/app/modules/web/Controllers/Category/ViewController.php index 08ee4879..cf2809fb 100644 --- a/app/modules/web/Controllers/Category/ViewController.php +++ b/app/modules/web/Controllers/Category/ViewController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Category; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -48,7 +48,7 @@ final class ViewController extends CategoryViewBase public function viewAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CATEGORY_VIEW)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CATEGORY_VIEW)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Client/ClientViewBase.php b/app/modules/web/Controllers/Client/ClientViewBase.php index 2ef70e13..f8ca7738 100644 --- a/app/modules/web/Controllers/Client/ClientViewBase.php +++ b/app/modules/web/Controllers/Client/ClientViewBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Client; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -86,7 +86,7 @@ abstract class ClientViewBase extends ControllerBase $this->view->assign( 'nextAction', - Acl::getActionRoute(ActionsInterface::ITEMS_MANAGE) + Acl::getActionRoute(AclActionsInterface::ITEMS_MANAGE) ); if ($this->view->isView === true) { @@ -99,11 +99,11 @@ abstract class ClientViewBase extends ControllerBase $this->view->assign( 'showViewCustomPass', - $this->acl->checkUserAccess(ActionsInterface::CUSTOMFIELD_VIEW_PASS) + $this->acl->checkUserAccess(AclActionsInterface::CUSTOMFIELD_VIEW_PASS) ); $this->view->assign( 'customFields', - $this->getCustomFieldsForItem(ActionsInterface::CLIENT, $clientId, $this->customFieldService) + $this->getCustomFieldsForItem(AclActionsInterface::CLIENT, $clientId, $this->customFieldService) ); } } diff --git a/app/modules/web/Controllers/Client/CreateController.php b/app/modules/web/Controllers/Client/CreateController.php index 58af49de..09b56b8a 100644 --- a/app/modules/web/Controllers/Client/CreateController.php +++ b/app/modules/web/Controllers/Client/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Client; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -45,7 +45,7 @@ final class CreateController extends ClientViewBase public function createAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CLIENT_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CLIENT_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Client/DeleteController.php b/app/modules/web/Controllers/Client/DeleteController.php index e25be03c..0c58de57 100644 --- a/app/modules/web/Controllers/Client/DeleteController.php +++ b/app/modules/web/Controllers/Client/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Client; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -51,7 +51,7 @@ final class DeleteController extends ClientSaveBase public function deleteAction(?int $id = null): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CLIENT_DELETE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CLIENT_DELETE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') @@ -61,7 +61,7 @@ final class DeleteController extends ClientSaveBase if ($id === null) { $this->clientService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->deleteCustomFieldsForItem(ActionsInterface::CLIENT, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::CLIENT, $id, $this->customFieldService); $this->eventDispatcher->notify( 'delete.client.selection', @@ -75,7 +75,7 @@ final class DeleteController extends ClientSaveBase } $this->clientService->delete($id); - $this->deleteCustomFieldsForItem(ActionsInterface::CLIENT, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::CLIENT, $id, $this->customFieldService); $this->eventDispatcher->notify( 'delete.client', diff --git a/app/modules/web/Controllers/Client/EditController.php b/app/modules/web/Controllers/Client/EditController.php index 237a08d4..6c6570a1 100644 --- a/app/modules/web/Controllers/Client/EditController.php +++ b/app/modules/web/Controllers/Client/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Client; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -49,7 +49,7 @@ final class EditController extends ClientViewBase public function editAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CLIENT_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CLIENT_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Client/SaveCreateController.php b/app/modules/web/Controllers/Client/SaveCreateController.php index 541845f8..a54ca2b5 100644 --- a/app/modules/web/Controllers/Client/SaveCreateController.php +++ b/app/modules/web/Controllers/Client/SaveCreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Client; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -48,14 +48,14 @@ final class SaveCreateController extends ClientSaveBase public function saveCreateAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CLIENT_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CLIENT_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::CLIENT_CREATE); + $this->form->validateFor(AclActionsInterface::CLIENT_CREATE); $itemData = $this->form->getItemData(); @@ -72,7 +72,7 @@ final class SaveCreateController extends ClientSaveBase ); $this->addCustomFieldsForItem( - ActionsInterface::CLIENT, + AclActionsInterface::CLIENT, $id, $this->request, $this->customFieldService diff --git a/app/modules/web/Controllers/Client/SaveEditController.php b/app/modules/web/Controllers/Client/SaveEditController.php index e514eea3..5f84301b 100644 --- a/app/modules/web/Controllers/Client/SaveEditController.php +++ b/app/modules/web/Controllers/Client/SaveEditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Client; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -52,14 +52,14 @@ final class SaveEditController extends ClientSaveBase public function saveEditAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CLIENT_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CLIENT_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::CLIENT_EDIT, $id); + $this->form->validateFor(AclActionsInterface::CLIENT_EDIT, $id); $this->clientService->update($this->form->getItemData()); @@ -72,7 +72,7 @@ final class SaveEditController extends ClientSaveBase ); $this->updateCustomFieldsForItem( - ActionsInterface::CLIENT, + AclActionsInterface::CLIENT, $id, $this->request, $this->customFieldService diff --git a/app/modules/web/Controllers/Client/SearchController.php b/app/modules/web/Controllers/Client/SearchController.php index c1241b7f..84ea1a3b 100644 --- a/app/modules/web/Controllers/Client/SearchController.php +++ b/app/modules/web/Controllers/Client/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Client; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -73,7 +73,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::CLIENT_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CLIENT_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Client/ViewController.php b/app/modules/web/Controllers/Client/ViewController.php index fffc6b5c..21268478 100644 --- a/app/modules/web/Controllers/Client/ViewController.php +++ b/app/modules/web/Controllers/Client/ViewController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Client; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -50,7 +50,7 @@ final class ViewController extends ClientViewBase public function viewAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CLIENT_VIEW)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CLIENT_VIEW)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/ConfigAccount/SaveController.php b/app/modules/web/Controllers/ConfigAccount/SaveController.php index f3e5c5e1..da7b2b47 100644 --- a/app/modules/web/Controllers/ConfigAccount/SaveController.php +++ b/app/modules/web/Controllers/ConfigAccount/SaveController.php @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Controllers\ConfigAccount; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -157,7 +157,7 @@ final class SaveController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_ACCOUNT); + $this->checkAccess(AclActionsInterface::CONFIG_ACCOUNT); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigBackup/DownloadBackupAppController.php b/app/modules/web/Controllers/ConfigBackup/DownloadBackupAppController.php index d4c030fc..4237a674 100644 --- a/app/modules/web/Controllers/ConfigBackup/DownloadBackupAppController.php +++ b/app/modules/web/Controllers/ConfigBackup/DownloadBackupAppController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ConfigBackup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Context\SessionContext; use SP\Core\Events\Event; @@ -105,7 +105,7 @@ final class DownloadBackupAppController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_BACKUP); + $this->checkAccess(AclActionsInterface::CONFIG_BACKUP); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigBackup/DownloadBackupDbController.php b/app/modules/web/Controllers/ConfigBackup/DownloadBackupDbController.php index f9f0d8f4..5ab37fe7 100644 --- a/app/modules/web/Controllers/ConfigBackup/DownloadBackupDbController.php +++ b/app/modules/web/Controllers/ConfigBackup/DownloadBackupDbController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\ConfigBackup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Context\SessionContext; use SP\Core\Events\Event; @@ -107,7 +107,7 @@ final class DownloadBackupDbController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_BACKUP); + $this->checkAccess(AclActionsInterface::CONFIG_BACKUP); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigBackup/DownloadExportController.php b/app/modules/web/Controllers/ConfigBackup/DownloadExportController.php index 7aca4afc..ddd070c5 100644 --- a/app/modules/web/Controllers/ConfigBackup/DownloadExportController.php +++ b/app/modules/web/Controllers/ConfigBackup/DownloadExportController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ConfigBackup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Context\SessionContext; use SP\Core\Events\Event; @@ -105,7 +105,7 @@ final class DownloadExportController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_BACKUP); + $this->checkAccess(AclActionsInterface::CONFIG_BACKUP); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigBackup/FileBackupController.php b/app/modules/web/Controllers/ConfigBackup/FileBackupController.php index 3acc9c95..30ffe08f 100644 --- a/app/modules/web/Controllers/ConfigBackup/FileBackupController.php +++ b/app/modules/web/Controllers/ConfigBackup/FileBackupController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ConfigBackup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Application; use SP\Core\Context\SessionContext; @@ -102,7 +102,7 @@ final class FileBackupController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_BACKUP); + $this->checkAccess(AclActionsInterface::CONFIG_BACKUP); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigBackup/XmlExportController.php b/app/modules/web/Controllers/ConfigBackup/XmlExportController.php index 3c6174d4..32c830cf 100644 --- a/app/modules/web/Controllers/ConfigBackup/XmlExportController.php +++ b/app/modules/web/Controllers/ConfigBackup/XmlExportController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\ConfigBackup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Application; use SP\Core\Context\SessionContext; @@ -138,7 +138,7 @@ final class XmlExportController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_BACKUP); + $this->checkAccess(AclActionsInterface::CONFIG_BACKUP); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigEncryption/RefreshController.php b/app/modules/web/Controllers/ConfigEncryption/RefreshController.php index f8df8175..da4b4d34 100644 --- a/app/modules/web/Controllers/ConfigEncryption/RefreshController.php +++ b/app/modules/web/Controllers/ConfigEncryption/RefreshController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ConfigEncryption; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Application; use SP\Core\Crypt\Hash; @@ -100,7 +100,7 @@ final class RefreshController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_CRYPT); + $this->checkAccess(AclActionsInterface::CONFIG_CRYPT); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigEncryption/SaveController.php b/app/modules/web/Controllers/ConfigEncryption/SaveController.php index 8cd0be28..f5600b2e 100644 --- a/app/modules/web/Controllers/ConfigEncryption/SaveController.php +++ b/app/modules/web/Controllers/ConfigEncryption/SaveController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ConfigEncryption; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Application; use SP\Core\Crypt\Hash; @@ -210,7 +210,7 @@ final class SaveController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_CRYPT); + $this->checkAccess(AclActionsInterface::CONFIG_CRYPT); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigEncryption/SaveTempController.php b/app/modules/web/Controllers/ConfigEncryption/SaveTempController.php index 2ba48178..e4a19213 100644 --- a/app/modules/web/Controllers/ConfigEncryption/SaveTempController.php +++ b/app/modules/web/Controllers/ConfigEncryption/SaveTempController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\ConfigEncryption; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Application; use SP\Core\Events\Event; @@ -119,7 +119,7 @@ final class SaveTempController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_CRYPT); + $this->checkAccess(AclActionsInterface::CONFIG_CRYPT); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigGeneral/DownloadConfigBackup.php b/app/modules/web/Controllers/ConfigGeneral/DownloadConfigBackup.php index c9b37d50..5f994bb0 100644 --- a/app/modules/web/Controllers/ConfigGeneral/DownloadConfigBackup.php +++ b/app/modules/web/Controllers/ConfigGeneral/DownloadConfigBackup.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ConfigGeneral; use Exception; use RuntimeException; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Application; use SP\Core\Events\Event; @@ -109,7 +109,7 @@ final class DownloadConfigBackup extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_GENERAL); + $this->checkAccess(AclActionsInterface::CONFIG_GENERAL); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigGeneral/DownloadLogController.php b/app/modules/web/Controllers/ConfigGeneral/DownloadLogController.php index 6507dfdc..0ffa6266 100644 --- a/app/modules/web/Controllers/ConfigGeneral/DownloadLogController.php +++ b/app/modules/web/Controllers/ConfigGeneral/DownloadLogController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ConfigGeneral; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Context\SessionContext; use SP\Core\Events\Event; @@ -92,7 +92,7 @@ final class DownloadLogController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_GENERAL); + $this->checkAccess(AclActionsInterface::CONFIG_GENERAL); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigGeneral/SaveController.php b/app/modules/web/Controllers/ConfigGeneral/SaveController.php index 8c9fb6bd..b33cba47 100644 --- a/app/modules/web/Controllers/ConfigGeneral/SaveController.php +++ b/app/modules/web/Controllers/ConfigGeneral/SaveController.php @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Controllers\ConfigGeneral; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -229,7 +229,7 @@ final class SaveController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_GENERAL); + $this->checkAccess(AclActionsInterface::CONFIG_GENERAL); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigImport/ImportController.php b/app/modules/web/Controllers/ConfigImport/ImportController.php index f7cd8b3a..d4224df0 100644 --- a/app/modules/web/Controllers/ConfigImport/ImportController.php +++ b/app/modules/web/Controllers/ConfigImport/ImportController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\ConfigImport; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Application; use SP\Core\Context\SessionContext; @@ -137,7 +137,7 @@ final class ImportController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_IMPORT); + $this->checkAccess(AclActionsInterface::CONFIG_IMPORT); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigLdap/CheckController.php b/app/modules/web/Controllers/ConfigLdap/CheckController.php index c7afc217..821330c6 100644 --- a/app/modules/web/Controllers/ConfigLdap/CheckController.php +++ b/app/modules/web/Controllers/ConfigLdap/CheckController.php @@ -27,7 +27,7 @@ namespace SP\Modules\Web\Controllers\ConfigLdap; use Exception; use JsonException; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Application; use SP\Core\Events\Event; @@ -112,7 +112,7 @@ final class CheckController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_LDAP); + $this->checkAccess(AclActionsInterface::CONFIG_LDAP); $this->extensionChecker->checkLdapAvailable(true); } catch (UnauthorizedPageException|CheckException $e) { diff --git a/app/modules/web/Controllers/ConfigLdap/CheckImportController.php b/app/modules/web/Controllers/ConfigLdap/CheckImportController.php index ab8efc33..e199115e 100644 --- a/app/modules/web/Controllers/ConfigLdap/CheckImportController.php +++ b/app/modules/web/Controllers/ConfigLdap/CheckImportController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ConfigLdap; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Application; use SP\Core\Events\Event; @@ -118,7 +118,7 @@ final class CheckImportController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_LDAP); + $this->checkAccess(AclActionsInterface::CONFIG_LDAP); $this->extensionChecker->checkLdapAvailable(true); } catch (UnauthorizedPageException|CheckException $e) { diff --git a/app/modules/web/Controllers/ConfigLdap/ImportController.php b/app/modules/web/Controllers/ConfigLdap/ImportController.php index f8d91324..4031524e 100644 --- a/app/modules/web/Controllers/ConfigLdap/ImportController.php +++ b/app/modules/web/Controllers/ConfigLdap/ImportController.php @@ -28,7 +28,7 @@ namespace SP\Modules\Web\Controllers\ConfigLdap; use Exception; use Klein\Klein; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Application; use SP\Core\Events\Event; @@ -165,7 +165,7 @@ final class ImportController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_LDAP); + $this->checkAccess(AclActionsInterface::CONFIG_LDAP); $this->extensionChecker->checkLdapAvailable(true); } catch (UnauthorizedPageException|CheckException $e) { diff --git a/app/modules/web/Controllers/ConfigLdap/SaveController.php b/app/modules/web/Controllers/ConfigLdap/SaveController.php index aa981177..c845e986 100644 --- a/app/modules/web/Controllers/ConfigLdap/SaveController.php +++ b/app/modules/web/Controllers/ConfigLdap/SaveController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\ConfigLdap; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -124,7 +124,7 @@ final class SaveController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_LDAP); + $this->checkAccess(AclActionsInterface::CONFIG_LDAP); $this->extensionChecker->checkLdapAvailable(true); } catch (UnauthorizedPageException|CheckException $e) { diff --git a/app/modules/web/Controllers/ConfigMail/CheckController.php b/app/modules/web/Controllers/ConfigMail/CheckController.php index d87fcb7a..89de2bfb 100644 --- a/app/modules/web/Controllers/ConfigMail/CheckController.php +++ b/app/modules/web/Controllers/ConfigMail/CheckController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ConfigMail; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Application; use SP\Core\Events\Event; @@ -132,7 +132,7 @@ final class CheckController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_MAIL); + $this->checkAccess(AclActionsInterface::CONFIG_MAIL); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigMail/SaveController.php b/app/modules/web/Controllers/ConfigMail/SaveController.php index 6a622333..1da0c874 100644 --- a/app/modules/web/Controllers/ConfigMail/SaveController.php +++ b/app/modules/web/Controllers/ConfigMail/SaveController.php @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Controllers\ConfigMail; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -120,7 +120,7 @@ final class SaveController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_MAIL); + $this->checkAccess(AclActionsInterface::CONFIG_MAIL); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/ConfigManager/IndexController.php b/app/modules/web/Controllers/ConfigManager/IndexController.php index 44369071..a2a1ffbf 100644 --- a/app/modules/web/Controllers/ConfigManager/IndexController.php +++ b/app/modules/web/Controllers/ConfigManager/IndexController.php @@ -29,7 +29,7 @@ use DI\NotFoundException; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\AppInfoInterface; use SP\Core\Application; use SP\Core\Crypt\CryptSessionHandler; @@ -129,39 +129,39 @@ final class IndexController extends ControllerBase */ protected function getTabs(): void { - if ($this->checkAccess(ActionsInterface::CONFIG_GENERAL)) { + if ($this->checkAccess(AclActionsInterface::CONFIG_GENERAL)) { $this->tabsHelper->addTab($this->getConfigGeneral()); } - if ($this->checkAccess(ActionsInterface::CONFIG_ACCOUNT)) { + if ($this->checkAccess(AclActionsInterface::CONFIG_ACCOUNT)) { $this->tabsHelper->addTab($this->getAccountConfig()); } - if ($this->checkAccess(ActionsInterface::CONFIG_WIKI)) { + if ($this->checkAccess(AclActionsInterface::CONFIG_WIKI)) { $this->tabsHelper->addTab($this->getWikiConfig()); } - if ($this->checkAccess(ActionsInterface::CONFIG_LDAP)) { + if ($this->checkAccess(AclActionsInterface::CONFIG_LDAP)) { $this->tabsHelper->addTab($this->getLdapConfig()); } - if ($this->checkAccess(ActionsInterface::CONFIG_MAIL)) { + if ($this->checkAccess(AclActionsInterface::CONFIG_MAIL)) { $this->tabsHelper->addTab($this->getMailConfig()); } - if ($this->checkAccess(ActionsInterface::CONFIG_CRYPT)) { + if ($this->checkAccess(AclActionsInterface::CONFIG_CRYPT)) { $this->tabsHelper->addTab($this->getEncryptionConfig()); } - if ($this->checkAccess(ActionsInterface::CONFIG_BACKUP)) { + if ($this->checkAccess(AclActionsInterface::CONFIG_BACKUP)) { $this->tabsHelper->addTab($this->getBackupConfig()); } - if ($this->checkAccess(ActionsInterface::CONFIG_IMPORT)) { + if ($this->checkAccess(AclActionsInterface::CONFIG_IMPORT)) { $this->tabsHelper->addTab($this->getImportConfig()); } - if ($this->checkAccess(ActionsInterface::CONFIG_GENERAL)) { + if ($this->checkAccess(AclActionsInterface::CONFIG_GENERAL)) { $this->tabsHelper->addTab($this->getInfo()); } @@ -172,7 +172,7 @@ final class IndexController extends ControllerBase ); $this->tabsHelper->renderTabs( - Acl::getActionRoute(ActionsInterface::CONFIG), + Acl::getActionRoute(AclActionsInterface::CONFIG), $this->request->analyzeInt('tabIndex', 0) ); diff --git a/app/modules/web/Controllers/ConfigWiki/SaveController.php b/app/modules/web/Controllers/ConfigWiki/SaveController.php index 391fb744..a5f2f1e1 100644 --- a/app/modules/web/Controllers/ConfigWiki/SaveController.php +++ b/app/modules/web/Controllers/ConfigWiki/SaveController.php @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Controllers\ConfigWiki; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedPageException; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; @@ -94,7 +94,7 @@ final class SaveController extends SimpleControllerBase { try { $this->checks(); - $this->checkAccess(ActionsInterface::CONFIG_WIKI); + $this->checkAccess(AclActionsInterface::CONFIG_WIKI); } catch (UnauthorizedPageException $e) { $this->eventDispatcher->notify('exception', new Event($e)); diff --git a/app/modules/web/Controllers/CustomField/CreateController.php b/app/modules/web/Controllers/CustomField/CreateController.php index e15a4d9d..e2e26e6f 100644 --- a/app/modules/web/Controllers/CustomField/CreateController.php +++ b/app/modules/web/Controllers/CustomField/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\CustomField; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -45,7 +45,7 @@ final class CreateController extends CustomFieldViewBase public function createAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CUSTOMFIELD_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CUSTOMFIELD_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/CustomField/CustomFieldViewBase.php b/app/modules/web/Controllers/CustomField/CustomFieldViewBase.php index 30649e88..60dc2f30 100644 --- a/app/modules/web/Controllers/CustomField/CustomFieldViewBase.php +++ b/app/modules/web/Controllers/CustomField/CustomFieldViewBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\CustomField; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -86,7 +86,7 @@ abstract class CustomFieldViewBase extends ControllerBase ->getItemsFromArraySelected([$customField->getModuleId()]) ); - $this->view->assign('nextAction', Acl::getActionRoute(ActionsInterface::ITEMS_MANAGE)); + $this->view->assign('nextAction', Acl::getActionRoute(AclActionsInterface::ITEMS_MANAGE)); if ($this->view->isView === true) { $this->view->assign('disabled', 'disabled'); diff --git a/app/modules/web/Controllers/CustomField/DeleteController.php b/app/modules/web/Controllers/CustomField/DeleteController.php index a687f4ce..85c46e00 100644 --- a/app/modules/web/Controllers/CustomField/DeleteController.php +++ b/app/modules/web/Controllers/CustomField/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\CustomField; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -51,7 +51,7 @@ final class DeleteController extends CustomFieldSaveBase public function deleteAction(?int $id = null): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CUSTOMFIELD_DELETE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CUSTOMFIELD_DELETE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/CustomField/EditController.php b/app/modules/web/Controllers/CustomField/EditController.php index 4b54d0a1..9f43ac0b 100644 --- a/app/modules/web/Controllers/CustomField/EditController.php +++ b/app/modules/web/Controllers/CustomField/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\CustomField; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -49,7 +49,7 @@ final class EditController extends CustomFieldViewBase public function editAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CUSTOMFIELD_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CUSTOMFIELD_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/CustomField/SaveCreateController.php b/app/modules/web/Controllers/CustomField/SaveCreateController.php index e98a9018..563879d0 100644 --- a/app/modules/web/Controllers/CustomField/SaveCreateController.php +++ b/app/modules/web/Controllers/CustomField/SaveCreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\CustomField; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -47,14 +47,14 @@ final class SaveCreateController extends CustomFieldSaveBase public function saveCreateAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CUSTOMFIELD_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CUSTOMFIELD_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::CUSTOMFIELD_CREATE); + $this->form->validateFor(AclActionsInterface::CUSTOMFIELD_CREATE); $itemData = $this->form->getItemData(); diff --git a/app/modules/web/Controllers/CustomField/SaveEditController.php b/app/modules/web/Controllers/CustomField/SaveEditController.php index ee945710..48fce5a3 100644 --- a/app/modules/web/Controllers/CustomField/SaveEditController.php +++ b/app/modules/web/Controllers/CustomField/SaveEditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\CustomField; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -51,14 +51,14 @@ final class SaveEditController extends CustomFieldSaveBase public function saveEditAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CUSTOMFIELD_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CUSTOMFIELD_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::CUSTOMFIELD_EDIT, $id); + $this->form->validateFor(AclActionsInterface::CUSTOMFIELD_EDIT, $id); $itemData = $this->form->getItemData(); diff --git a/app/modules/web/Controllers/CustomField/SearchController.php b/app/modules/web/Controllers/CustomField/SearchController.php index ff3a51b2..057e44d2 100644 --- a/app/modules/web/Controllers/CustomField/SearchController.php +++ b/app/modules/web/Controllers/CustomField/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\CustomField; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -72,7 +72,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::CUSTOMFIELD_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CUSTOMFIELD_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/CustomField/ViewController.php b/app/modules/web/Controllers/CustomField/ViewController.php index 414388db..76a88fc4 100644 --- a/app/modules/web/Controllers/CustomField/ViewController.php +++ b/app/modules/web/Controllers/CustomField/ViewController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\CustomField; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -50,7 +50,7 @@ final class ViewController extends CustomFieldViewBase public function viewAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::CUSTOMFIELD_VIEW)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::CUSTOMFIELD_VIEW)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Eventlog/IndexController.php b/app/modules/web/Controllers/Eventlog/IndexController.php index c18f6fa5..4b696408 100644 --- a/app/modules/web/Controllers/Eventlog/IndexController.php +++ b/app/modules/web/Controllers/Eventlog/IndexController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Eventlog; use DI\DependencyException; use DI\NotFoundException; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; use SP\Core\Exceptions\SPException; @@ -52,7 +52,7 @@ final class IndexController extends ControllerBase */ public function indexAction(): void { - if (!$this->acl->checkUserAccess(ActionsInterface::EVENTLOG)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::EVENTLOG)) { return; } @@ -62,4 +62,4 @@ final class IndexController extends ControllerBase $this->view(); } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Eventlog/SearchController.php b/app/modules/web/Controllers/Eventlog/SearchController.php index 304c9e8d..44d518ee 100644 --- a/app/modules/web/Controllers/Eventlog/SearchController.php +++ b/app/modules/web/Controllers/Eventlog/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Eventlog; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Domain\Security\Ports\EventlogServiceInterface; use SP\Html\DataGrid\DataGridInterface; @@ -70,7 +70,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::EVENTLOG_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::EVENTLOG_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php index e2d88ba2..c15ef0f3 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountActionsHelper.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Account; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\UI\ThemeIcons; use SP\Domain\Account\Services\AccountAcl; @@ -58,15 +58,15 @@ final class AccountActionsHelper extends HelperBase public function getViewAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::ACCOUNT_VIEW); + $action->setId(AclActionsInterface::ACCOUNT_VIEW); $action->setType(DataGridActionType::VIEW_ITEM); $action->setName(__('Account Details')); $action->setTitle(__('Account Details')); $action->addClass('btn-action'); $action->setIcon($this->icons->getIconView()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowView'); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW)); - $action->addData('onclick', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); + $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); $action->addAttribute('type', 'button'); return $action; @@ -107,7 +107,7 @@ final class AccountActionsHelper extends HelperBase $actions[] = $this->getEditAction()->addData('item-id', $accountActionsDto->getAccountId()); } - if ($accountAcl->getActionId() === ActionsInterface::ACCOUNT_VIEW + if ($accountAcl->getActionId() === AclActionsInterface::ACCOUNT_VIEW && !$accountAcl->isShowEdit() && $this->configData->isMailRequestsEnabled() ) { @@ -140,8 +140,8 @@ final class AccountActionsHelper extends HelperBase $action->setTitle(__('Back')); $action->addClass('btn-action'); $action->setIcon($this->icons->getIconBack()); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW)); - $action->addData('onclick', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); + $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); $action->addAttribute('type', 'button'); return $action; @@ -153,15 +153,15 @@ final class AccountActionsHelper extends HelperBase public function getEditPassAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::ACCOUNT_EDIT_PASS); + $action->setId(AclActionsInterface::ACCOUNT_EDIT_PASS); $action->setType(DataGridActionType::VIEW_ITEM); $action->setName(__('Edit Account Password')); $action->setTitle(__('Edit Account Password')); $action->addClass('btn-action'); $action->setIcon($this->icons->getIconEditPass()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowViewPass'); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::ACCOUNT_EDIT_PASS)); - $action->addData('onclick', Acl::getActionRoute(ActionsInterface::ACCOUNT_EDIT_PASS)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT_PASS)); + $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT_PASS)); $action->addAttribute('type', 'button'); return $action; @@ -173,15 +173,15 @@ final class AccountActionsHelper extends HelperBase public function getEditAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::ACCOUNT_EDIT); + $action->setId(AclActionsInterface::ACCOUNT_EDIT); $action->setType(DataGridActionType::EDIT_ITEM); $action->setName(__('Edit Account')); $action->setTitle(__('Edit Account')); $action->addClass('btn-action'); $action->setIcon($this->icons->getIconEdit()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowEdit'); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::ACCOUNT_EDIT)); - $action->addData('onclick', Acl::getActionRoute(ActionsInterface::ACCOUNT_EDIT)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT)); + $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_EDIT)); $action->addAttribute('type', 'button'); return $action; @@ -193,14 +193,14 @@ final class AccountActionsHelper extends HelperBase public function getRequestAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::ACCOUNT_REQUEST); + $action->setId(AclActionsInterface::ACCOUNT_REQUEST); $action->setName(__('Request Modification')); $action->setTitle(__('Request Modification')); $action->addClass('btn-action'); $action->setIcon($this->icons->getIconEmail()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowRequest'); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::ACCOUNT_REQUEST)); - $action->addData('onclick', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_REQUEST)); + $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); $action->addAttribute('type', 'submit'); return $action; @@ -212,7 +212,7 @@ final class AccountActionsHelper extends HelperBase public function getRestoreAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::ACCOUNT_EDIT_RESTORE); + $action->setId(AclActionsInterface::ACCOUNT_EDIT_RESTORE); $action->setType(DataGridActionType::VIEW_ITEM); $action->setName(__('Restore account from this point')); $action->setTitle(__('Restore account from this point')); @@ -231,7 +231,7 @@ final class AccountActionsHelper extends HelperBase public function getSaveAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::ACCOUNT); + $action->setId(AclActionsInterface::ACCOUNT); $action->setType(DataGridActionType::VIEW_ITEM); $action->setName(__('Save')); $action->setTitle(__('Save')); @@ -331,15 +331,15 @@ final class AccountActionsHelper extends HelperBase public function getDeleteAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::ACCOUNT_DELETE); + $action->setId(AclActionsInterface::ACCOUNT_DELETE); $action->setType(DataGridActionType::DELETE_ITEM); $action->setName(__('Remove Account')); $action->setTitle(__('Remove Account')); $action->addClass('btn-action'); $action->setIcon($this->icons->getIconDelete()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowDelete'); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::ACCOUNT_DELETE)); - $action->addData('onclick', Acl::getActionRoute(ActionsInterface::ACCOUNT_DELETE)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_DELETE)); + $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_DELETE)); $action->addAttribute('type', 'button'); return $action; @@ -351,14 +351,14 @@ final class AccountActionsHelper extends HelperBase public function getPublicLinkRefreshAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::PUBLICLINK_REFRESH); + $action->setId(AclActionsInterface::PUBLICLINK_REFRESH); $action->setName(__('Update Public Link')); $action->setTitle(__('Update Public Link')); $action->addClass('btn-action'); $action->setIcon($this->icons->getIconPublicLink()); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::PUBLICLINK_REFRESH)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::PUBLICLINK_REFRESH)); $action->addData('onclick', 'link/refresh'); - $action->addData('action-next', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW)); + $action->addData('action-next', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); $action->addAttribute('type', 'button'); return $action; @@ -373,14 +373,14 @@ final class AccountActionsHelper extends HelperBase $icon->setIcon('link_off'); $action = new DataGridAction(); - $action->setId(ActionsInterface::PUBLICLINK_DELETE); + $action->setId(AclActionsInterface::PUBLICLINK_DELETE); $action->setName(__('Delete Public Link')); $action->setTitle(__('Delete Public Link')); $action->addClass('btn-action'); $action->setIcon($icon); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::PUBLICLINK_DELETE)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::PUBLICLINK_DELETE)); $action->addData('onclick', 'link/delete'); - $action->addData('action-next', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW)); + $action->addData('action-next', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); $action->addAttribute('type', 'button'); return $action; @@ -392,14 +392,14 @@ final class AccountActionsHelper extends HelperBase public function getPublicLinkAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::PUBLICLINK_CREATE); + $action->setId(AclActionsInterface::PUBLICLINK_CREATE); $action->setName(__('Create Public Link')); $action->setTitle(__('Create Public Link')); $action->addClass('btn-action'); $action->setIcon($this->icons->getIconPublicLink()); $action->addData('action-route', 'publicLink/saveCreateFromAccount'); $action->addData('onclick', 'link/save'); - $action->addData('action-next', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW)); + $action->addData('action-next', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); $action->addAttribute('type', 'button'); return $action; @@ -411,16 +411,16 @@ final class AccountActionsHelper extends HelperBase public function getViewPassHistoryAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::ACCOUNT_VIEW_PASS); + $action->setId(AclActionsInterface::ACCOUNT_VIEW_PASS); $action->setType(DataGridActionType::VIEW_ITEM); $action->setName(__('View password')); $action->setTitle(__('View password')); $action->addClass('btn-action'); $action->setIcon($this->icons->getIconViewPass()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowViewPass'); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::ACCOUNT_HISTORY_VIEW_PASS)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_HISTORY_VIEW_PASS)); $action->addData('action-full', 1); - $action->addData('onclick', Acl::getActionRoute(ActionsInterface::ACCOUNT_HISTORY_VIEW_PASS)); + $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_HISTORY_VIEW_PASS)); $action->addAttribute('type', 'button'); return $action; @@ -432,7 +432,7 @@ final class AccountActionsHelper extends HelperBase public function getCopyPassHistoryAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::ACCOUNT_VIEW_PASS); + $action->setId(AclActionsInterface::ACCOUNT_VIEW_PASS); $action->setType(DataGridActionType::VIEW_ITEM); $action->setName(__('Copy Password to Clipboard')); $action->setTitle(__('Copy Password to Clipboard')); @@ -440,7 +440,7 @@ final class AccountActionsHelper extends HelperBase $action->addClass('clip-pass-button'); $action->setIcon($this->icons->getIconClipboard()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowCopyPass'); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::ACCOUNT_HISTORY_COPY_PASS)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_HISTORY_COPY_PASS)); $action->addData('action-full', 0); $action->addData('useclipboard', '1'); $action->addAttribute('type', 'button'); @@ -454,16 +454,16 @@ final class AccountActionsHelper extends HelperBase public function getViewPassAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::ACCOUNT_VIEW_PASS); + $action->setId(AclActionsInterface::ACCOUNT_VIEW_PASS); $action->setType(DataGridActionType::VIEW_ITEM); $action->setName(__('View password')); $action->setTitle(__('View password')); $action->addClass('btn-action'); $action->setIcon($this->icons->getIconViewPass()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowViewPass'); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW_PASS)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW_PASS)); $action->addData('action-full', 1); - $action->addData('onclick', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW_PASS)); + $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW_PASS)); $action->addAttribute('type', 'button'); return $action; @@ -475,7 +475,7 @@ final class AccountActionsHelper extends HelperBase public function getCopyPassAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::ACCOUNT_VIEW_PASS); + $action->setId(AclActionsInterface::ACCOUNT_VIEW_PASS); $action->setType(DataGridActionType::VIEW_ITEM); $action->setName(__('Copy Password to Clipboard')); $action->setTitle(__('Copy Password to Clipboard')); @@ -483,7 +483,7 @@ final class AccountActionsHelper extends HelperBase $action->addClass('clip-pass-button'); $action->setIcon($this->icons->getIconClipboard()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowCopyPass'); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::ACCOUNT_COPY_PASS)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_COPY_PASS)); $action->addData('action-full', 0); $action->addData('useclipboard', '1'); $action->addAttribute('type', 'button'); @@ -497,17 +497,17 @@ final class AccountActionsHelper extends HelperBase public function getCopyAction(): DataGridAction { $action = new DataGridAction(); - $action->setId(ActionsInterface::ACCOUNT_COPY); + $action->setId(AclActionsInterface::ACCOUNT_COPY); $action->setType(DataGridActionType::MENUBAR_ITEM); $action->setName(__('Copy Account')); $action->setTitle(__('Copy Account')); $action->addClass('btn-action'); $action->setIcon($this->icons->getIconCopy()); $action->setRuntimeFilter(AccountSearchItem::class, 'isShowCopy'); - $action->addData('action-route', Acl::getActionRoute(ActionsInterface::ACCOUNT_COPY)); - $action->addData('onclick', Acl::getActionRoute(ActionsInterface::ACCOUNT_COPY)); + $action->addData('action-route', Acl::getActionRoute(AclActionsInterface::ACCOUNT_COPY)); + $action->addData('onclick', Acl::getActionRoute(AclActionsInterface::ACCOUNT_COPY)); $action->addAttribute('type', 'button'); return $action; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Account/AccountHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountHelper.php index b1a4a111..699611f7 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountHelper.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Account; use SP\Core\Acl\AccountPermissionException; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Bootstrap\BootstrapBase; use SP\Core\Exceptions\ConstraintException; @@ -325,7 +325,7 @@ final class AccountHelper extends AccountHelperBase $this->view->assign( 'customFields', $this->getCustomFieldsForItem( - ActionsInterface::ACCOUNT, + AclActionsInterface::ACCOUNT, $this->accountId, $this->customFieldService ) @@ -344,22 +344,22 @@ final class AccountHelper extends AccountHelperBase $this->view->assign('otherAccounts', $this->accountService->getForUser($this->accountId)); $this->view->assign( 'addClientEnabled', - !$this->isView && $this->acl->checkUserAccess(ActionsInterface::CLIENT) + !$this->isView && $this->acl->checkUserAccess(AclActionsInterface::CLIENT) ); - $this->view->assign('addClientRoute', Acl::getActionRoute(ActionsInterface::CLIENT_CREATE)); + $this->view->assign('addClientRoute', Acl::getActionRoute(AclActionsInterface::CLIENT_CREATE)); $this->view->assign( 'addCategoryEnabled', - !$this->isView && $this->acl->checkUserAccess(ActionsInterface::CATEGORY) + !$this->isView && $this->acl->checkUserAccess(AclActionsInterface::CATEGORY) ); - $this->view->assign('addCategoryRoute', Acl::getActionRoute(ActionsInterface::CATEGORY_CREATE)); + $this->view->assign('addCategoryRoute', Acl::getActionRoute(AclActionsInterface::CATEGORY_CREATE)); $this->view->assign( 'addTagEnabled', !$this->isView - && $this->acl->checkUserAccess(ActionsInterface::TAG) + && $this->acl->checkUserAccess(AclActionsInterface::TAG) ); - $this->view->assign('addTagRoute', Acl::getActionRoute(ActionsInterface::TAG_CREATE)); - $this->view->assign('fileListRoute', Acl::getActionRoute(ActionsInterface::ACCOUNT_FILE_LIST)); - $this->view->assign('fileUploadRoute', Acl::getActionRoute(ActionsInterface::ACCOUNT_FILE_UPLOAD)); + $this->view->assign('addTagRoute', Acl::getActionRoute(AclActionsInterface::TAG_CREATE)); + $this->view->assign('fileListRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FILE_LIST)); + $this->view->assign('fileUploadRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FILE_UPLOAD)); $this->view->assign('disabled', $this->isView ? 'disabled' : ''); $this->view->assign('readonly', $this->isView ? 'readonly' : ''); $this->view->assign('showViewCustomPass', $this->accountAcl->isShowViewPass()); diff --git a/app/modules/web/Controllers/Helpers/Account/AccountPasswordHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountPasswordHelper.php index 814e9348..3e237362 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountPasswordHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountPasswordHelper.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Account; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Crypt\Crypt; use SP\Core\Crypt\Session as CryptSession; @@ -120,7 +120,7 @@ final class AccountPasswordHelper extends HelperBase */ private function checkActionAccess(): void { - if (!$this->acl->checkUserAccess(ActionsInterface::ACCOUNT_VIEW_PASS)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::ACCOUNT_VIEW_PASS)) { throw new HelperException(__u('You don\'t have permission to access this account')); } } diff --git a/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php b/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php index 47fd4e72..3c4208c5 100644 --- a/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php +++ b/app/modules/web/Controllers/Helpers/Account/AccountSearchHelper.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -27,7 +27,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Account; use DI\DependencyException; use DI\NotFoundException; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -92,7 +92,7 @@ final class AccountSearchHelper extends HelperBase $this->accountActionsHelper = $accountActionsHelper; $this->queryTimeStart = microtime(true); - $this->isIndex = $this->request->analyzeString('r') === Acl::getActionRoute(ActionsInterface::ACCOUNT); + $this->isIndex = $this->request->analyzeString('r') === Acl::getActionRoute(AclActionsInterface::ACCOUNT); $this->setVars(); } @@ -221,7 +221,7 @@ final class AccountSearchHelper extends HelperBase $gridPager->setLimitCount($this->accountSearchFilter->getLimitCount()); $gridPager->setOnClickFunction('account/sort'); $gridPager->setFilterOn($this->filterOn); - $gridPager->setSourceAction(new DataGridActionSearch(ActionsInterface::ACCOUNT_SEARCH)); + $gridPager->setSourceAction(new DataGridActionSearch(AclActionsInterface::ACCOUNT_SEARCH)); $userPreferences = $this->context->getUserData()->getPreferences() ?? new UserPreferencesData(); $showOptionalActions = $userPreferences->isOptionalActions() @@ -341,10 +341,10 @@ final class AccountSearchHelper extends HelperBase $this->view->assign('searchTxt', $this->accountSearchFilter->getTxtSearch()); $this->view->assign('searchGlobal', $this->accountSearchFilter->getGlobalSearch()); $this->view->assign('searchFavorites', $this->accountSearchFilter->isSearchFavorites()); - $this->view->assign('searchRoute', Acl::getActionRoute(ActionsInterface::ACCOUNT_SEARCH)); - $this->view->assign('favoriteRouteOn', Acl::getActionRoute(ActionsInterface::ACCOUNT_FAVORITE_ADD)); - $this->view->assign('favoriteRouteOff', Acl::getActionRoute(ActionsInterface::ACCOUNT_FAVORITE_DELETE)); - $this->view->assign('viewAccountRoute', Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW)); + $this->view->assign('searchRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_SEARCH)); + $this->view->assign('favoriteRouteOn', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FAVORITE_ADD)); + $this->view->assign('favoriteRouteOff', Acl::getActionRoute(AclActionsInterface::ACCOUNT_FAVORITE_DELETE)); + $this->view->assign('viewAccountRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); } /** diff --git a/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php b/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php index 08fac702..323b96d8 100644 --- a/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/AccountGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionHelp; use SP\Html\DataGrid\Action\DataGridActionSearch; @@ -140,14 +140,14 @@ final class AccountGrid extends GridBase private function getSearchAction(): DataGridActionSearch { $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::ACCOUNTMGR_SEARCH); + $gridActionSearch->setId(AclActionsInterface::ACCOUNTMGR_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchAccount'); $gridActionSearch->setTitle(__('Search for Account')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ACCOUNTMGR_SEARCH) + Acl::getActionRoute(AclActionsInterface::ACCOUNTMGR_SEARCH) ); return $gridActionSearch; @@ -159,15 +159,15 @@ final class AccountGrid extends GridBase public function getViewAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ACCOUNT_VIEW); + $gridAction->setId(AclActionsInterface::ACCOUNT_VIEW); $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('Account Details')); $gridAction->setTitle(__('Account Details')); $gridAction->setIcon($this->icons->getIconView()); - $gridAction->setOnClickFunction(Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW)); + $gridAction->setOnClickFunction(Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW)); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ACCOUNT_VIEW) + Acl::getActionRoute(AclActionsInterface::ACCOUNT_VIEW) ); return $gridAction; @@ -179,7 +179,7 @@ final class AccountGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ACCOUNTMGR_DELETE); + $gridAction->setId(AclActionsInterface::ACCOUNTMGR_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Remove Account')); $gridAction->setTitle(__('Remove Account')); @@ -187,7 +187,7 @@ final class AccountGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ACCOUNTMGR_DELETE) + Acl::getActionRoute(AclActionsInterface::ACCOUNTMGR_DELETE) ); return $gridAction; @@ -199,7 +199,7 @@ final class AccountGrid extends GridBase public function getBulkEditAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ACCOUNTMGR_BULK_EDIT); + $gridAction->setId(AclActionsInterface::ACCOUNTMGR_BULK_EDIT); $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Bulk Update')); $gridAction->setTitle(__('Bulk Update')); @@ -207,9 +207,9 @@ final class AccountGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ACCOUNTMGR_BULK_EDIT) + Acl::getActionRoute(AclActionsInterface::ACCOUNTMGR_BULK_EDIT) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php b/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php index 67011041..6352e519 100644 --- a/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/AccountHistoryGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -144,14 +144,14 @@ final class AccountHistoryGrid extends GridBase private function getSearchAction(): DataGridActionSearch { $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::ACCOUNTMGR_HISTORY_SEARCH); + $gridActionSearch->setId(AclActionsInterface::ACCOUNTMGR_HISTORY_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchAccountHistory'); $gridActionSearch->setTitle(__('Search for Account')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ACCOUNTMGR_HISTORY_SEARCH) + Acl::getActionRoute(AclActionsInterface::ACCOUNTMGR_HISTORY_SEARCH) ); return $gridActionSearch; @@ -163,7 +163,7 @@ final class AccountHistoryGrid extends GridBase private function getRestoreAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ACCOUNTMGR_HISTORY_RESTORE); + $gridAction->setId(AclActionsInterface::ACCOUNTMGR_HISTORY_RESTORE); $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Account Restore')); $gridAction->setTitle(__('Account Restore')); @@ -171,7 +171,7 @@ final class AccountHistoryGrid extends GridBase $gridAction->setOnClickFunction('accountManager/restore'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ACCOUNTMGR_HISTORY_RESTORE) + Acl::getActionRoute(AclActionsInterface::ACCOUNTMGR_HISTORY_RESTORE) ); return $gridAction; @@ -183,7 +183,7 @@ final class AccountHistoryGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ACCOUNTMGR_HISTORY_DELETE); + $gridAction->setId(AclActionsInterface::ACCOUNTMGR_HISTORY_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Remove Account')); $gridAction->setTitle(__('Remove Account')); @@ -191,9 +191,9 @@ final class AccountHistoryGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ACCOUNTMGR_HISTORY_DELETE) + Acl::getActionRoute(AclActionsInterface::ACCOUNTMGR_HISTORY_DELETE) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php b/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php index 39a87f52..945281ec 100644 --- a/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/AuthTokenGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -135,14 +135,14 @@ final class AuthTokenGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::AUTHTOKEN_SEARCH); + $gridActionSearch->setId(AclActionsInterface::AUTHTOKEN_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchToken'); $gridActionSearch->setTitle(__('Search for Token')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::AUTHTOKEN_SEARCH) + Acl::getActionRoute(AclActionsInterface::AUTHTOKEN_SEARCH) ); return $gridActionSearch; @@ -154,7 +154,7 @@ final class AuthTokenGrid extends GridBase private function getCreateAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::AUTHTOKEN_CREATE); + $gridAction->setId(AclActionsInterface::AUTHTOKEN_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Authorization')); $gridAction->setTitle(__('New Authorization')); @@ -163,7 +163,7 @@ final class AuthTokenGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::AUTHTOKEN_CREATE) + Acl::getActionRoute(AclActionsInterface::AUTHTOKEN_CREATE) ); return $gridAction; @@ -175,7 +175,7 @@ final class AuthTokenGrid extends GridBase private function getViewAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::AUTHTOKEN_VIEW); + $gridAction->setId(AclActionsInterface::AUTHTOKEN_VIEW); $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View Authorization token')); $gridAction->setTitle(__('View Authorization token')); @@ -183,7 +183,7 @@ final class AuthTokenGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::AUTHTOKEN_VIEW) + Acl::getActionRoute(AclActionsInterface::AUTHTOKEN_VIEW) ); return $gridAction; @@ -195,7 +195,7 @@ final class AuthTokenGrid extends GridBase private function getEditAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::AUTHTOKEN_EDIT); + $gridAction->setId(AclActionsInterface::AUTHTOKEN_EDIT); $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Authorization')); $gridAction->setTitle(__('Edit Authorization')); @@ -203,7 +203,7 @@ final class AuthTokenGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::AUTHTOKEN_EDIT) + Acl::getActionRoute(AclActionsInterface::AUTHTOKEN_EDIT) ); return $gridAction; @@ -215,7 +215,7 @@ final class AuthTokenGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::AUTHTOKEN_DELETE); + $gridAction->setId(AclActionsInterface::AUTHTOKEN_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Authorization')); $gridAction->setTitle(__('Delete Authorization')); @@ -223,9 +223,9 @@ final class AuthTokenGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::AUTHTOKEN_DELETE) + Acl::getActionRoute(AclActionsInterface::AUTHTOKEN_DELETE) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php b/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php index 71988f90..abcb585f 100644 --- a/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/CategoryGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -128,14 +128,14 @@ final class CategoryGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::CATEGORY_SEARCH); + $gridActionSearch->setId(AclActionsInterface::CATEGORY_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchCategory'); $gridActionSearch->setTitle(__('Search for Category')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::CATEGORY_SEARCH) + Acl::getActionRoute(AclActionsInterface::CATEGORY_SEARCH) ); return $gridActionSearch; @@ -147,7 +147,7 @@ final class CategoryGrid extends GridBase private function getCreateAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::CATEGORY_CREATE); + $gridAction->setId(AclActionsInterface::CATEGORY_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Category')); $gridAction->setTitle(__('New Category')); @@ -156,7 +156,7 @@ final class CategoryGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::CATEGORY_CREATE) + Acl::getActionRoute(AclActionsInterface::CATEGORY_CREATE) ); return $gridAction; @@ -168,7 +168,7 @@ final class CategoryGrid extends GridBase private function getEditAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::CATEGORY_EDIT); + $gridAction->setId(AclActionsInterface::CATEGORY_EDIT); $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Category')); $gridAction->setTitle(__('Edit Category')); @@ -176,7 +176,7 @@ final class CategoryGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::CATEGORY_EDIT) + Acl::getActionRoute(AclActionsInterface::CATEGORY_EDIT) ); return $gridAction; @@ -188,7 +188,7 @@ final class CategoryGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::CATEGORY_DELETE); + $gridAction->setId(AclActionsInterface::CATEGORY_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Category')); $gridAction->setTitle(__('Delete Category')); @@ -196,9 +196,9 @@ final class CategoryGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::CATEGORY_DELETE) + Acl::getActionRoute(AclActionsInterface::CATEGORY_DELETE) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php b/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php index 72d2c130..3b20a70b 100644 --- a/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/ClientGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -135,14 +135,14 @@ final class ClientGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::CLIENT_SEARCH); + $gridActionSearch->setId(AclActionsInterface::CLIENT_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchClient'); $gridActionSearch->setTitle(__('Search for Client')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::CLIENT_SEARCH) + Acl::getActionRoute(AclActionsInterface::CLIENT_SEARCH) ); return $gridActionSearch; @@ -154,7 +154,7 @@ final class ClientGrid extends GridBase private function getCreateAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::CLIENT_CREATE); + $gridAction->setId(AclActionsInterface::CLIENT_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Client')); $gridAction->setTitle(__('New Client')); @@ -163,7 +163,7 @@ final class ClientGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::CLIENT_CREATE) + Acl::getActionRoute(AclActionsInterface::CLIENT_CREATE) ); return $gridAction; @@ -175,7 +175,7 @@ final class ClientGrid extends GridBase private function getEditAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::CLIENT_EDIT); + $gridAction->setId(AclActionsInterface::CLIENT_EDIT); $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Client')); $gridAction->setTitle(__('Edit Client')); @@ -183,7 +183,7 @@ final class ClientGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::CLIENT_EDIT) + Acl::getActionRoute(AclActionsInterface::CLIENT_EDIT) ); return $gridAction; @@ -195,7 +195,7 @@ final class ClientGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::CLIENT_DELETE); + $gridAction->setId(AclActionsInterface::CLIENT_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Client')); $gridAction->setTitle(__('Delete Client')); @@ -203,9 +203,9 @@ final class ClientGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::CLIENT_DELETE) + Acl::getActionRoute(AclActionsInterface::CLIENT_DELETE) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php b/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php index 3651011c..18e6613c 100644 --- a/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/CustomFieldGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Domain\CustomField\Services\CustomFieldDefService; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; @@ -142,14 +142,14 @@ final class CustomFieldGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::CUSTOMFIELD_SEARCH); + $gridActionSearch->setId(AclActionsInterface::CUSTOMFIELD_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchCustomField'); $gridActionSearch->setTitle(__('Search for Field')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::CUSTOMFIELD_SEARCH) + Acl::getActionRoute(AclActionsInterface::CUSTOMFIELD_SEARCH) ); return $gridActionSearch; @@ -161,7 +161,7 @@ final class CustomFieldGrid extends GridBase private function getCreateAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::CUSTOMFIELD_CREATE); + $gridAction->setId(AclActionsInterface::CUSTOMFIELD_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Field')); $gridAction->setTitle(__('New Field')); @@ -170,7 +170,7 @@ final class CustomFieldGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::CUSTOMFIELD_CREATE) + Acl::getActionRoute(AclActionsInterface::CUSTOMFIELD_CREATE) ); return $gridAction; @@ -182,7 +182,7 @@ final class CustomFieldGrid extends GridBase private function getEditAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::CUSTOMFIELD_EDIT); + $gridAction->setId(AclActionsInterface::CUSTOMFIELD_EDIT); $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Field')); $gridAction->setTitle(__('Edit Field')); @@ -190,7 +190,7 @@ final class CustomFieldGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::CUSTOMFIELD_EDIT) + Acl::getActionRoute(AclActionsInterface::CUSTOMFIELD_EDIT) ); return $gridAction; @@ -202,7 +202,7 @@ final class CustomFieldGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::CUSTOMFIELD_DELETE); + $gridAction->setId(AclActionsInterface::CUSTOMFIELD_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Field')); $gridAction->setTitle(__('Delete Field')); @@ -210,9 +210,9 @@ final class CustomFieldGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::CUSTOMFIELD_DELETE) + Acl::getActionRoute(AclActionsInterface::CUSTOMFIELD_DELETE) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php b/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php index 2540f142..7dcfe0ad 100644 --- a/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/EventlogGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -165,14 +165,14 @@ final class EventlogGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::EVENTLOG_SEARCH); + $gridActionSearch->setId(AclActionsInterface::EVENTLOG_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchEvent'); $gridActionSearch->setTitle(__('Search for Events')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::EVENTLOG_SEARCH) + Acl::getActionRoute(AclActionsInterface::EVENTLOG_SEARCH) ); return $gridActionSearch; @@ -184,7 +184,7 @@ final class EventlogGrid extends GridBase private function getRefrestAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::EVENTLOG_SEARCH); + $gridAction->setId(AclActionsInterface::EVENTLOG_SEARCH); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setSkip(true); $gridAction->setName(__('Refresh')); @@ -194,7 +194,7 @@ final class EventlogGrid extends GridBase $gridAction->addData('action-form', 'frmSearchEvent'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::EVENTLOG_SEARCH) + Acl::getActionRoute(AclActionsInterface::EVENTLOG_SEARCH) ); return $gridAction; @@ -206,7 +206,7 @@ final class EventlogGrid extends GridBase private function getClearAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::EVENTLOG_CLEAR); + $gridAction->setId(AclActionsInterface::EVENTLOG_CLEAR); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setSkip(true); $gridAction->setName(__('Clear the event log out')); @@ -215,9 +215,9 @@ final class EventlogGrid extends GridBase $gridAction->setOnClickFunction('eventlog/clear'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::EVENTLOG_CLEAR) + Acl::getActionRoute(AclActionsInterface::EVENTLOG_CLEAR) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/FileGrid.php b/app/modules/web/Controllers/Helpers/Grid/FileGrid.php index 81ce525c..d0b6a116 100644 --- a/app/modules/web/Controllers/Helpers/Grid/FileGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/FileGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -140,14 +140,14 @@ final class FileGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::ACCOUNT_FILE_SEARCH); + $gridActionSearch->setId(AclActionsInterface::ACCOUNT_FILE_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchFile'); $gridActionSearch->setTitle(__('Search for File')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ACCOUNT_FILE_SEARCH) + Acl::getActionRoute(AclActionsInterface::ACCOUNT_FILE_SEARCH) ); return $gridActionSearch; @@ -159,7 +159,7 @@ final class FileGrid extends GridBase private function getViewAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ACCOUNT_FILE_VIEW); + $gridAction->setId(AclActionsInterface::ACCOUNT_FILE_VIEW); $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View File')); $gridAction->setTitle(__('View File')); @@ -168,7 +168,7 @@ final class FileGrid extends GridBase $gridAction->setFilterRowSource('type', 'application/pdf'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ACCOUNT_FILE_VIEW) + Acl::getActionRoute(AclActionsInterface::ACCOUNT_FILE_VIEW) ); return $gridAction; @@ -180,7 +180,7 @@ final class FileGrid extends GridBase private function getDownloadAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ACCOUNT_FILE_DOWNLOAD); + $gridAction->setId(AclActionsInterface::ACCOUNT_FILE_DOWNLOAD); $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('Download File')); $gridAction->setTitle(__('Download File')); @@ -188,7 +188,7 @@ final class FileGrid extends GridBase $gridAction->setOnClickFunction('file/download'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ACCOUNT_FILE_DOWNLOAD) + Acl::getActionRoute(AclActionsInterface::ACCOUNT_FILE_DOWNLOAD) ); $gridAction->setRuntimeData( function ($dataItem) { @@ -205,7 +205,7 @@ final class FileGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ACCOUNT_FILE_DELETE); + $gridAction->setId(AclActionsInterface::ACCOUNT_FILE_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete File')); $gridAction->setTitle(__('Delete File')); @@ -213,9 +213,9 @@ final class FileGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ACCOUNT_FILE_DELETE) + Acl::getActionRoute(AclActionsInterface::ACCOUNT_FILE_DELETE) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php b/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php index edcc3fe2..071062a2 100644 --- a/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/ItemPresetGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Domain\ItemPreset\Ports\ItemPresetInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; @@ -139,14 +139,14 @@ final class ItemPresetGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::ITEMPRESET_SEARCH); + $gridActionSearch->setId(AclActionsInterface::ITEMPRESET_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchItemPreset'); $gridActionSearch->setTitle(__('Search for Value')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ITEMPRESET_SEARCH) + Acl::getActionRoute(AclActionsInterface::ITEMPRESET_SEARCH) ); return $gridActionSearch; @@ -158,7 +158,7 @@ final class ItemPresetGrid extends GridBase private function getCreatePermissionAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ITEMPRESET_CREATE); + $gridAction->setId(AclActionsInterface::ITEMPRESET_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('Permission Preset')); $gridAction->setTitle(__('New Permission Preset')); @@ -169,7 +169,7 @@ final class ItemPresetGrid extends GridBase $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); - $route = Acl::getActionRoute(ActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_ACCOUNT_PERMISSION; + $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_ACCOUNT_PERMISSION; $gridAction->addData('action-route', $route); @@ -182,7 +182,7 @@ final class ItemPresetGrid extends GridBase private function getCreatePrivateAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ITEMPRESET_CREATE); + $gridAction->setId(AclActionsInterface::ITEMPRESET_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('Private Account Preset')); $gridAction->setTitle(__('New Private Account Preset')); @@ -193,7 +193,7 @@ final class ItemPresetGrid extends GridBase $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); - $route = Acl::getActionRoute(ActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_ACCOUNT_PRIVATE; + $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_ACCOUNT_PRIVATE; $gridAction->addData('action-route', $route); @@ -206,7 +206,7 @@ final class ItemPresetGrid extends GridBase private function getCreateSessionTimeoutAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ITEMPRESET_CREATE); + $gridAction->setId(AclActionsInterface::ITEMPRESET_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('Session Timeout Preset')); $gridAction->setTitle(__('New Session Timeout Preset')); @@ -217,7 +217,7 @@ final class ItemPresetGrid extends GridBase $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); - $route = Acl::getActionRoute(ActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_SESSION_TIMEOUT; + $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_SESSION_TIMEOUT; $gridAction->addData('action-route', $route); @@ -230,7 +230,7 @@ final class ItemPresetGrid extends GridBase private function getCreateAccountPasswordAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ITEMPRESET_CREATE); + $gridAction->setId(AclActionsInterface::ITEMPRESET_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('Account Password Preset')); $gridAction->setTitle(__('New Account Password Preset')); @@ -241,7 +241,7 @@ final class ItemPresetGrid extends GridBase $gridAction->setSkip(true); $gridAction->setOnClickFunction('appMgmt/show'); - $route = Acl::getActionRoute(ActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_ACCOUNT_PASSWORD; + $route = Acl::getActionRoute(AclActionsInterface::ITEMPRESET_CREATE) . '/' . ItemPresetInterface::ITEM_TYPE_ACCOUNT_PASSWORD; $gridAction->addData('action-route', $route); @@ -254,7 +254,7 @@ final class ItemPresetGrid extends GridBase private function getEditAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ITEMPRESET_EDIT); + $gridAction->setId(AclActionsInterface::ITEMPRESET_EDIT); $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Value')); $gridAction->setTitle(__('Edit Value')); @@ -262,7 +262,7 @@ final class ItemPresetGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ITEMPRESET_EDIT) + Acl::getActionRoute(AclActionsInterface::ITEMPRESET_EDIT) ); return $gridAction; @@ -274,7 +274,7 @@ final class ItemPresetGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::ITEMPRESET_DELETE); + $gridAction->setId(AclActionsInterface::ITEMPRESET_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Value')); $gridAction->setTitle(__('Delete Value')); @@ -282,7 +282,7 @@ final class ItemPresetGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::ITEMPRESET_DELETE) + Acl::getActionRoute(AclActionsInterface::ITEMPRESET_DELETE) ); return $gridAction; diff --git a/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php b/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php index c8dc85fa..475c07c6 100644 --- a/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/NotificationGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionInterface; use SP\Html\DataGrid\Action\DataGridActionSearch; @@ -175,14 +175,14 @@ final class NotificationGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::NOTIFICATION_SEARCH); + $gridActionSearch->setId(AclActionsInterface::NOTIFICATION_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchNotification'); $gridActionSearch->setTitle(__('Search for Notification')); $gridActionSearch->setOnSubmitFunction('notification/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::NOTIFICATION_SEARCH) + Acl::getActionRoute(AclActionsInterface::NOTIFICATION_SEARCH) ); return $gridActionSearch; @@ -194,7 +194,7 @@ final class NotificationGrid extends GridBase private function getCreateAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::NOTIFICATION_CREATE); + $gridAction->setId(AclActionsInterface::NOTIFICATION_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Notification')); $gridAction->setTitle(__('New Notification')); @@ -203,7 +203,7 @@ final class NotificationGrid extends GridBase $gridAction->setOnClickFunction('notification/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::NOTIFICATION_CREATE) + Acl::getActionRoute(AclActionsInterface::NOTIFICATION_CREATE) ); return $gridAction; @@ -215,7 +215,7 @@ final class NotificationGrid extends GridBase private function getViewAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::NOTIFICATION_VIEW); + $gridAction->setId(AclActionsInterface::NOTIFICATION_VIEW); $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View Notification')); $gridAction->setTitle(__('View Notification')); @@ -223,7 +223,7 @@ final class NotificationGrid extends GridBase $gridAction->setOnClickFunction('notification/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::NOTIFICATION_VIEW) + Acl::getActionRoute(AclActionsInterface::NOTIFICATION_VIEW) ); return $gridAction; @@ -251,7 +251,7 @@ final class NotificationGrid extends GridBase private function getCheckAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::NOTIFICATION_CHECK); + $gridAction->setId(AclActionsInterface::NOTIFICATION_CHECK); $gridAction->setName(__('Checkout Notification')); $gridAction->setTitle(__('Checkout Notification')); $gridAction->setIcon($this->icons->getIconEnabled()); @@ -259,11 +259,11 @@ final class NotificationGrid extends GridBase $gridAction->setFilterRowSource('checked'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::NOTIFICATION_CHECK) + Acl::getActionRoute(AclActionsInterface::NOTIFICATION_CHECK) ); $gridAction->addData( 'action-next', - Acl::getActionRoute(ActionsInterface::NOTIFICATION) + Acl::getActionRoute(AclActionsInterface::NOTIFICATION) ); return $gridAction; @@ -275,14 +275,14 @@ final class NotificationGrid extends GridBase private function getEditAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::NOTIFICATION_EDIT); + $gridAction->setId(AclActionsInterface::NOTIFICATION_EDIT); $gridAction->setName(__('Edit Notification')); $gridAction->setTitle(__('Edit Notification')); $gridAction->setIcon($this->icons->getIconEdit()); $gridAction->setOnClickFunction('notification/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::NOTIFICATION_EDIT) + Acl::getActionRoute(AclActionsInterface::NOTIFICATION_EDIT) ); return $gridAction; @@ -294,7 +294,7 @@ final class NotificationGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::NOTIFICATION_DELETE); + $gridAction->setId(AclActionsInterface::NOTIFICATION_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Notification')); $gridAction->setTitle(__('Delete Notification')); @@ -303,13 +303,13 @@ final class NotificationGrid extends GridBase $gridAction->setFilterRowSource('checked', 0); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::NOTIFICATION_DELETE) + Acl::getActionRoute(AclActionsInterface::NOTIFICATION_DELETE) ); $gridAction->addData( 'action-next', - Acl::getActionRoute(ActionsInterface::NOTIFICATION) + Acl::getActionRoute(AclActionsInterface::NOTIFICATION) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php b/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php index af93c127..e510a290 100644 --- a/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/PluginGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -137,14 +137,14 @@ final class PluginGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::PLUGIN_SEARCH); + $gridActionSearch->setId(AclActionsInterface::PLUGIN_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchPlugin'); $gridActionSearch->setTitle(__('Search for Plugin')); $gridActionSearch->setOnSubmitFunction('plugin/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PLUGIN_SEARCH) + Acl::getActionRoute(AclActionsInterface::PLUGIN_SEARCH) ); return $gridActionSearch; @@ -156,7 +156,7 @@ final class PluginGrid extends GridBase private function getViewAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PLUGIN_VIEW); + $gridAction->setId(AclActionsInterface::PLUGIN_VIEW); $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View Plugin')); $gridAction->setTitle(__('View Plugin')); @@ -165,7 +165,7 @@ final class PluginGrid extends GridBase $gridAction->setFilterRowSource('available', 0); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PLUGIN_VIEW) + Acl::getActionRoute(AclActionsInterface::PLUGIN_VIEW) ); return $gridAction; @@ -177,7 +177,7 @@ final class PluginGrid extends GridBase private function getEnableAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PLUGIN_ENABLE); + $gridAction->setId(AclActionsInterface::PLUGIN_ENABLE); $gridAction->setName(__('Enable')); $gridAction->setTitle(__('Enable')); $gridAction->setIcon($this->icons->getIconEnabled()); @@ -186,7 +186,7 @@ final class PluginGrid extends GridBase $gridAction->setFilterRowSource('available', 0); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PLUGIN_ENABLE) + Acl::getActionRoute(AclActionsInterface::PLUGIN_ENABLE) ); $gridAction->addData('action-method', 'get'); @@ -199,7 +199,7 @@ final class PluginGrid extends GridBase private function getDisableAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PLUGIN_DISABLE); + $gridAction->setId(AclActionsInterface::PLUGIN_DISABLE); $gridAction->setName(__('Disable')); $gridAction->setTitle(__('Disable')); $gridAction->setIcon($this->icons->getIconDisabled()); @@ -208,7 +208,7 @@ final class PluginGrid extends GridBase $gridAction->setFilterRowSource('available', 0); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PLUGIN_DISABLE) + Acl::getActionRoute(AclActionsInterface::PLUGIN_DISABLE) ); $gridAction->addData('action-method', 'get'); @@ -221,7 +221,7 @@ final class PluginGrid extends GridBase private function getResetAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PLUGIN_RESET); + $gridAction->setId(AclActionsInterface::PLUGIN_RESET); $gridAction->setName(__('Reset Data')); $gridAction->setTitle(__('Reset Data')); $gridAction->setIcon($this->icons->getIconRefresh()); @@ -229,12 +229,12 @@ final class PluginGrid extends GridBase $gridAction->setFilterRowSource('available', 0); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PLUGIN_RESET) + Acl::getActionRoute(AclActionsInterface::PLUGIN_RESET) ); $gridAction->addData('action-method', 'get'); $gridAction->addData( 'action-next', - Acl::getActionRoute(ActionsInterface::PLUGIN) + Acl::getActionRoute(AclActionsInterface::PLUGIN) ); return $gridAction; @@ -246,7 +246,7 @@ final class PluginGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PLUGIN_DELETE); + $gridAction->setId(AclActionsInterface::PLUGIN_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Plugin')); $gridAction->setTitle(__('Delete Plugin')); @@ -255,13 +255,13 @@ final class PluginGrid extends GridBase $gridAction->setOnClickFunction('plugin/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PLUGIN_DELETE) + Acl::getActionRoute(AclActionsInterface::PLUGIN_DELETE) ); $gridAction->addData( 'action-next', - Acl::getActionRoute(ActionsInterface::PLUGIN) + Acl::getActionRoute(AclActionsInterface::PLUGIN) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php b/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php index b12ed6c8..8c47bedb 100644 --- a/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/PublicLinkGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -147,14 +147,14 @@ final class PublicLinkGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::PUBLICLINK_SEARCH); + $gridActionSearch->setId(AclActionsInterface::PUBLICLINK_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchLink'); $gridActionSearch->setTitle(__('Search for Link')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PUBLICLINK_SEARCH) + Acl::getActionRoute(AclActionsInterface::PUBLICLINK_SEARCH) ); return $gridActionSearch; @@ -166,7 +166,7 @@ final class PublicLinkGrid extends GridBase private function getCreateAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PUBLICLINK_CREATE); + $gridAction->setId(AclActionsInterface::PUBLICLINK_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Link')); $gridAction->setTitle(__('New Link')); @@ -175,7 +175,7 @@ final class PublicLinkGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PUBLICLINK_CREATE) + Acl::getActionRoute(AclActionsInterface::PUBLICLINK_CREATE) ); return $gridAction; @@ -187,7 +187,7 @@ final class PublicLinkGrid extends GridBase private function getViewAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PUBLICLINK_VIEW); + $gridAction->setId(AclActionsInterface::PUBLICLINK_VIEW); $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View Link')); $gridAction->setTitle(__('View Link')); @@ -195,7 +195,7 @@ final class PublicLinkGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PUBLICLINK_VIEW) + Acl::getActionRoute(AclActionsInterface::PUBLICLINK_VIEW) ); return $gridAction; @@ -207,14 +207,14 @@ final class PublicLinkGrid extends GridBase private function getRefreshAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PUBLICLINK_REFRESH); + $gridAction->setId(AclActionsInterface::PUBLICLINK_REFRESH); $gridAction->setName(__('Renew Link')); $gridAction->setTitle(__('Renew Link')); $gridAction->setIcon($this->icons->getIconRefresh()); $gridAction->setOnClickFunction('link/refresh'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PUBLICLINK_REFRESH) + Acl::getActionRoute(AclActionsInterface::PUBLICLINK_REFRESH) ); return $gridAction; @@ -226,7 +226,7 @@ final class PublicLinkGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PUBLICLINK_DELETE); + $gridAction->setId(AclActionsInterface::PUBLICLINK_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Link')); $gridAction->setTitle(__('Delete Link')); @@ -234,9 +234,9 @@ final class PublicLinkGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PUBLICLINK_DELETE) + Acl::getActionRoute(AclActionsInterface::PUBLICLINK_DELETE) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/TagGrid.php b/app/modules/web/Controllers/Helpers/Grid/TagGrid.php index 95c6d068..111216fb 100644 --- a/app/modules/web/Controllers/Helpers/Grid/TagGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/TagGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -127,14 +127,14 @@ final class TagGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::TAG_SEARCH); + $gridActionSearch->setId(AclActionsInterface::TAG_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchTag'); $gridActionSearch->setTitle(__('Search for Tag')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::TAG_SEARCH) + Acl::getActionRoute(AclActionsInterface::TAG_SEARCH) ); return $gridActionSearch; @@ -146,7 +146,7 @@ final class TagGrid extends GridBase private function getCreateAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::TAG_CREATE); + $gridAction->setId(AclActionsInterface::TAG_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Tag')); $gridAction->setTitle(__('New Tag')); @@ -155,7 +155,7 @@ final class TagGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::TAG_CREATE) + Acl::getActionRoute(AclActionsInterface::TAG_CREATE) ); return $gridAction; @@ -167,7 +167,7 @@ final class TagGrid extends GridBase private function getEditAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::TAG_EDIT); + $gridAction->setId(AclActionsInterface::TAG_EDIT); $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Tag')); $gridAction->setTitle(__('Edit Tag')); @@ -175,7 +175,7 @@ final class TagGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::TAG_EDIT) + Acl::getActionRoute(AclActionsInterface::TAG_EDIT) ); return $gridAction; @@ -187,7 +187,7 @@ final class TagGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::TAG_DELETE); + $gridAction->setId(AclActionsInterface::TAG_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Tag')); $gridAction->setTitle(__('Delete Tag')); @@ -195,9 +195,9 @@ final class TagGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::TAG_DELETE) + Acl::getActionRoute(AclActionsInterface::TAG_DELETE) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php b/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php index b343e09e..023b5a54 100644 --- a/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/TrackGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -166,14 +166,14 @@ final class TrackGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::TRACK_SEARCH); + $gridActionSearch->setId(AclActionsInterface::TRACK_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchTrack'); $gridActionSearch->setTitle(__('Search for track')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::TRACK_SEARCH) + Acl::getActionRoute(AclActionsInterface::TRACK_SEARCH) ); return $gridActionSearch; @@ -185,7 +185,7 @@ final class TrackGrid extends GridBase private function getRefrestAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::TRACK_SEARCH); + $gridAction->setId(AclActionsInterface::TRACK_SEARCH); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setSkip(true); $gridAction->setName(__('Refresh')); @@ -195,7 +195,7 @@ final class TrackGrid extends GridBase $gridAction->addData('action-form', 'frmSearchTrack'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::TRACK_SEARCH) + Acl::getActionRoute(AclActionsInterface::TRACK_SEARCH) ); return $gridAction; @@ -207,16 +207,16 @@ final class TrackGrid extends GridBase private function getClearAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::TRACK_CLEAR); + $gridAction->setId(AclActionsInterface::TRACK_CLEAR); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setSkip(true); - $gridAction->setName(Acl::getActionInfo(ActionsInterface::TRACK_CLEAR)); - $gridAction->setTitle(Acl::getActionInfo(ActionsInterface::TRACK_CLEAR)); + $gridAction->setName(Acl::getActionInfo(AclActionsInterface::TRACK_CLEAR)); + $gridAction->setTitle(Acl::getActionInfo(AclActionsInterface::TRACK_CLEAR)); $gridAction->setIcon($this->icons->getIconClear()); $gridAction->setOnClickFunction('track/clear'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::TRACK_CLEAR) + Acl::getActionRoute(AclActionsInterface::TRACK_CLEAR) ); return $gridAction; @@ -228,18 +228,18 @@ final class TrackGrid extends GridBase private function getUnlockAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::TRACK_UNLOCK); + $gridAction->setId(AclActionsInterface::TRACK_UNLOCK); $gridAction->setType(DataGridActionType::EDIT_ITEM); - $gridAction->setName(Acl::getActionInfo(ActionsInterface::TRACK_UNLOCK)); - $gridAction->setTitle(Acl::getActionInfo(ActionsInterface::TRACK_UNLOCK)); + $gridAction->setName(Acl::getActionInfo(AclActionsInterface::TRACK_UNLOCK)); + $gridAction->setTitle(Acl::getActionInfo(AclActionsInterface::TRACK_UNLOCK)); $gridAction->setIcon($this->icons->getIconCheck()); $gridAction->setOnClickFunction('track/unlock'); $gridAction->setFilterRowSource('tracked', 0); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::TRACK_UNLOCK) + Acl::getActionRoute(AclActionsInterface::TRACK_UNLOCK) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/UserGrid.php b/app/modules/web/Controllers/Helpers/Grid/UserGrid.php index 89af2144..0e89e3aa 100644 --- a/app/modules/web/Controllers/Helpers/Grid/UserGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/UserGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -152,14 +152,14 @@ final class UserGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::USER_SEARCH); + $gridActionSearch->setId(AclActionsInterface::USER_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchUser'); $gridActionSearch->setTitle(__('Search for User')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::USER_SEARCH) + Acl::getActionRoute(AclActionsInterface::USER_SEARCH) ); return $gridActionSearch; @@ -171,7 +171,7 @@ final class UserGrid extends GridBase private function getCreateAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::USER_CREATE); + $gridAction->setId(AclActionsInterface::USER_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New User')); $gridAction->setTitle(__('New User')); @@ -180,7 +180,7 @@ final class UserGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::USER_CREATE) + Acl::getActionRoute(AclActionsInterface::USER_CREATE) ); return $gridAction; @@ -192,7 +192,7 @@ final class UserGrid extends GridBase private function getViewAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::USER_VIEW); + $gridAction->setId(AclActionsInterface::USER_VIEW); $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View User Details')); $gridAction->setTitle(__('View User Details')); @@ -200,7 +200,7 @@ final class UserGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::USER_VIEW) + Acl::getActionRoute(AclActionsInterface::USER_VIEW) ); return $gridAction; @@ -212,7 +212,7 @@ final class UserGrid extends GridBase private function getEditAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::USER_EDIT); + $gridAction->setId(AclActionsInterface::USER_EDIT); $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit User')); $gridAction->setTitle(__('Edit User')); @@ -220,7 +220,7 @@ final class UserGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::USER_EDIT) + Acl::getActionRoute(AclActionsInterface::USER_EDIT) ); return $gridAction; @@ -232,7 +232,7 @@ final class UserGrid extends GridBase private function getEditPassAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::USER_EDIT_PASS); + $gridAction->setId(AclActionsInterface::USER_EDIT_PASS); $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Change User\'s Password')); $gridAction->setTitle(__('Change User\'s Password')); @@ -241,7 +241,7 @@ final class UserGrid extends GridBase $gridAction->setFilterRowSource('isLdap'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::USER_EDIT_PASS) + Acl::getActionRoute(AclActionsInterface::USER_EDIT_PASS) ); return $gridAction; @@ -253,7 +253,7 @@ final class UserGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::USER_DELETE); + $gridAction->setId(AclActionsInterface::USER_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete User')); $gridAction->setTitle(__('Delete User')); @@ -261,9 +261,9 @@ final class UserGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::USER_DELETE) + Acl::getActionRoute(AclActionsInterface::USER_DELETE) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php b/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php index d2697b11..8c4da938 100644 --- a/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/UserGroupGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -130,14 +130,14 @@ final class UserGroupGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::GROUP_SEARCH); + $gridActionSearch->setId(AclActionsInterface::GROUP_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchGroup'); $gridActionSearch->setTitle(__('Search for Group')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::GROUP_SEARCH) + Acl::getActionRoute(AclActionsInterface::GROUP_SEARCH) ); return $gridActionSearch; @@ -149,7 +149,7 @@ final class UserGroupGrid extends GridBase private function getCreateAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::GROUP_CREATE); + $gridAction->setId(AclActionsInterface::GROUP_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Group')); $gridAction->setTitle(__('New Group')); @@ -158,7 +158,7 @@ final class UserGroupGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::GROUP_CREATE) + Acl::getActionRoute(AclActionsInterface::GROUP_CREATE) ); return $gridAction; @@ -170,7 +170,7 @@ final class UserGroupGrid extends GridBase private function getViewAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::GROUP_VIEW); + $gridAction->setId(AclActionsInterface::GROUP_VIEW); $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View Group')); $gridAction->setTitle(__('View Group')); @@ -178,7 +178,7 @@ final class UserGroupGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::GROUP_VIEW) + Acl::getActionRoute(AclActionsInterface::GROUP_VIEW) ); return $gridAction; @@ -190,7 +190,7 @@ final class UserGroupGrid extends GridBase private function getEditAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::GROUP_EDIT); + $gridAction->setId(AclActionsInterface::GROUP_EDIT); $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Group')); $gridAction->setTitle(__('Edit Group')); @@ -198,7 +198,7 @@ final class UserGroupGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::GROUP_EDIT) + Acl::getActionRoute(AclActionsInterface::GROUP_EDIT) ); return $gridAction; @@ -210,7 +210,7 @@ final class UserGroupGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::GROUP_DELETE); + $gridAction->setId(AclActionsInterface::GROUP_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Group')); $gridAction->setTitle(__('Delete Group')); @@ -218,9 +218,9 @@ final class UserGroupGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::GROUP_DELETE) + Acl::getActionRoute(AclActionsInterface::GROUP_DELETE) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php b/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php index 30efa33e..ed0baf5e 100644 --- a/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php +++ b/app/modules/web/Controllers/Helpers/Grid/UserProfileGrid.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Helpers\Grid; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Html\DataGrid\Action\DataGridAction; use SP\Html\DataGrid\Action\DataGridActionSearch; use SP\Html\DataGrid\Action\DataGridActionType; @@ -128,14 +128,14 @@ final class UserProfileGrid extends GridBase { // Grid Actions $gridActionSearch = new DataGridActionSearch(); - $gridActionSearch->setId(ActionsInterface::PROFILE_SEARCH); + $gridActionSearch->setId(AclActionsInterface::PROFILE_SEARCH); $gridActionSearch->setType(DataGridActionType::SEARCH_ITEM); $gridActionSearch->setName('frmSearchProfile'); $gridActionSearch->setTitle(__('Search for Profile')); $gridActionSearch->setOnSubmitFunction('appMgmt/search'); $gridActionSearch->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PROFILE_SEARCH) + Acl::getActionRoute(AclActionsInterface::PROFILE_SEARCH) ); return $gridActionSearch; @@ -147,7 +147,7 @@ final class UserProfileGrid extends GridBase private function getCreateAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PROFILE_CREATE); + $gridAction->setId(AclActionsInterface::PROFILE_CREATE); $gridAction->setType(DataGridActionType::MENUBAR_ITEM); $gridAction->setName(__('New Profile')); $gridAction->setTitle(__('New Profile')); @@ -156,7 +156,7 @@ final class UserProfileGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PROFILE_CREATE) + Acl::getActionRoute(AclActionsInterface::PROFILE_CREATE) ); return $gridAction; @@ -168,7 +168,7 @@ final class UserProfileGrid extends GridBase private function getViewAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PROFILE_VIEW); + $gridAction->setId(AclActionsInterface::PROFILE_VIEW); $gridAction->setType(DataGridActionType::VIEW_ITEM); $gridAction->setName(__('View Profile Details')); $gridAction->setTitle(__('View Profile Details')); @@ -176,7 +176,7 @@ final class UserProfileGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PROFILE_VIEW) + Acl::getActionRoute(AclActionsInterface::PROFILE_VIEW) ); return $gridAction; @@ -188,7 +188,7 @@ final class UserProfileGrid extends GridBase private function getEditAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PROFILE_EDIT); + $gridAction->setId(AclActionsInterface::PROFILE_EDIT); $gridAction->setType(DataGridActionType::EDIT_ITEM); $gridAction->setName(__('Edit Profile')); $gridAction->setTitle(__('Edit Profile')); @@ -196,7 +196,7 @@ final class UserProfileGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/show'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PROFILE_EDIT) + Acl::getActionRoute(AclActionsInterface::PROFILE_EDIT) ); return $gridAction; @@ -208,7 +208,7 @@ final class UserProfileGrid extends GridBase private function getDeleteAction(): DataGridAction { $gridAction = new DataGridAction(); - $gridAction->setId(ActionsInterface::PROFILE_DELETE); + $gridAction->setId(AclActionsInterface::PROFILE_DELETE); $gridAction->setType(DataGridActionType::DELETE_ITEM); $gridAction->setName(__('Delete Profile')); $gridAction->setTitle(__('Delete Profile')); @@ -216,9 +216,9 @@ final class UserProfileGrid extends GridBase $gridAction->setOnClickFunction('appMgmt/delete'); $gridAction->addData( 'action-route', - Acl::getActionRoute(ActionsInterface::PROFILE_DELETE) + Acl::getActionRoute(AclActionsInterface::PROFILE_DELETE) ); return $gridAction; } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Helpers/LayoutHelper.php b/app/modules/web/Controllers/Helpers/LayoutHelper.php index 1e02ec88..593f23c1 100644 --- a/app/modules/web/Controllers/Helpers/LayoutHelper.php +++ b/app/modules/web/Controllers/Helpers/LayoutHelper.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Helpers; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\AppInfoInterface; use SP\Core\Application; use SP\Core\Bootstrap\BootstrapBase; @@ -123,7 +123,7 @@ final class LayoutHelper extends HelperBase $this->view->assign('logo_no_bg_color', $baseUrl.'/public/images/logo_full_nobg_outline_color.png'); $this->view->assign('logo_no_bg', $baseUrl.'/public/images/logo_full_nobg_outline.png'); $this->view->assign('httpsEnabled', $this->request->isHttps()); - $this->view->assign('homeRoute', Acl::getActionRoute(ActionsInterface::ACCOUNT)); + $this->view->assign('homeRoute', Acl::getActionRoute(AclActionsInterface::ACCOUNT)); $this->loggedIn = $this->context->isLoggedIn(); @@ -277,88 +277,88 @@ final class LayoutHelper extends HelperBase $actions = []; $actionSearch = new DataGridAction(); - $actionSearch->setId(ActionsInterface::ACCOUNT); + $actionSearch->setId(AclActionsInterface::ACCOUNT); $actionSearch->setTitle(__('Search')); $actionSearch->setIcon($icons->getIconSearch()); $actionSearch->setData([ 'historyReset' => 1, 'view' => 'search', - 'route' => Acl::getActionRoute(ActionsInterface::ACCOUNT), + 'route' => Acl::getActionRoute(AclActionsInterface::ACCOUNT), ]); $actions[] = $actionSearch; - if ($acl->checkUserAccess(ActionsInterface::ACCOUNT_CREATE)) { + if ($acl->checkUserAccess(AclActionsInterface::ACCOUNT_CREATE)) { $actionNewAccount = new DataGridAction(); - $actionNewAccount->setId(ActionsInterface::ACCOUNT_CREATE); + $actionNewAccount->setId(AclActionsInterface::ACCOUNT_CREATE); $actionNewAccount->setTitle(__('New Account')); $actionNewAccount->setIcon($icons->getIconAdd()); $actionNewAccount->setData([ 'historyReset' => 0, 'view' => 'account', - 'route' => Acl::getActionRoute(ActionsInterface::ACCOUNT_CREATE), + 'route' => Acl::getActionRoute(AclActionsInterface::ACCOUNT_CREATE), ]); $actions[] = $actionNewAccount; } - if ($acl->checkUserAccess(ActionsInterface::ACCESS_MANAGE)) { + if ($acl->checkUserAccess(AclActionsInterface::ACCESS_MANAGE)) { $actionAccessManager = new DataGridAction(); - $actionAccessManager->setId(ActionsInterface::ACCESS_MANAGE); - $actionAccessManager->setTitle(Acl::getActionInfo(ActionsInterface::ACCESS_MANAGE)); + $actionAccessManager->setId(AclActionsInterface::ACCESS_MANAGE); + $actionAccessManager->setTitle(Acl::getActionInfo(AclActionsInterface::ACCESS_MANAGE)); $actionAccessManager->setIcon($icons->getIconAccount()); $actionAccessManager->setData([ 'historyReset' => 0, 'view' => 'datatabs', - 'route' => Acl::getActionRoute(ActionsInterface::ACCESS_MANAGE), + 'route' => Acl::getActionRoute(AclActionsInterface::ACCESS_MANAGE), ]); $actions[] = $actionAccessManager; } - if ($acl->checkUserAccess(ActionsInterface::ITEMS_MANAGE)) { + if ($acl->checkUserAccess(AclActionsInterface::ITEMS_MANAGE)) { $actionItemManager = new DataGridAction(); - $actionItemManager->setId(ActionsInterface::ITEMS_MANAGE); - $actionItemManager->setTitle(Acl::getActionInfo(ActionsInterface::ITEMS_MANAGE)); + $actionItemManager->setId(AclActionsInterface::ITEMS_MANAGE); + $actionItemManager->setTitle(Acl::getActionInfo(AclActionsInterface::ITEMS_MANAGE)); $actionItemManager->setIcon($icons->getIconGroup()); $actionItemManager->setData([ 'historyReset' => 0, 'view' => 'datatabs', - 'route' => Acl::getActionRoute(ActionsInterface::ITEMS_MANAGE), + 'route' => Acl::getActionRoute(AclActionsInterface::ITEMS_MANAGE), ]); $actions[] = $actionItemManager; } - if ($acl->checkUserAccess(ActionsInterface::SECURITY_MANAGE)) { + if ($acl->checkUserAccess(AclActionsInterface::SECURITY_MANAGE)) { $actionSecurityManager = new DataGridAction(); - $actionSecurityManager->setId(ActionsInterface::SECURITY_MANAGE); - $actionSecurityManager->setTitle(Acl::getActionInfo(ActionsInterface::SECURITY_MANAGE)); + $actionSecurityManager->setId(AclActionsInterface::SECURITY_MANAGE); + $actionSecurityManager->setTitle(Acl::getActionInfo(AclActionsInterface::SECURITY_MANAGE)); $actionSecurityManager->setIcon($icons->getIconByName('security')); $actionSecurityManager->setData([ 'historyReset' => 0, 'view' => 'datatabs', - 'route' => Acl::getActionRoute(ActionsInterface::SECURITY_MANAGE), + 'route' => Acl::getActionRoute(AclActionsInterface::SECURITY_MANAGE), ]); $actions[] = $actionSecurityManager; } - if ($acl->checkUserAccess(ActionsInterface::PLUGIN)) { + if ($acl->checkUserAccess(AclActionsInterface::PLUGIN)) { $actionPlugins = new DataGridAction(); - $actionPlugins->setId(ActionsInterface::PLUGIN); + $actionPlugins->setId(AclActionsInterface::PLUGIN); $actionPlugins->setTitle(__('Plugins')); $actionPlugins->setIcon($icons->getIconByName('extension')); $actionPlugins->setData([ 'historyReset' => 1, 'view' => 'plugin', - 'route' => Acl::getActionRoute(ActionsInterface::PLUGIN), + 'route' => Acl::getActionRoute(AclActionsInterface::PLUGIN), ]); $actions[] = $actionPlugins; } - if ($acl->checkUserAccess(ActionsInterface::CONFIG)) { + if ($acl->checkUserAccess(AclActionsInterface::CONFIG)) { $actionConfigManager = new DataGridAction(); $actionConfigManager->setId('config'); $actionConfigManager->setTitle(__('Configuration')); @@ -366,7 +366,7 @@ final class LayoutHelper extends HelperBase $actionConfigManager->setData([ 'historyReset' => 1, 'view' => 'config', - 'route' => Acl::getActionRoute(ActionsInterface::CONFIG), + 'route' => Acl::getActionRoute(AclActionsInterface::CONFIG), ]); $actions[] = $actionConfigManager; diff --git a/app/modules/web/Controllers/ItemManager/IndexController.php b/app/modules/web/Controllers/ItemManager/IndexController.php index 4ed8b110..503f90ff 100644 --- a/app/modules/web/Controllers/ItemManager/IndexController.php +++ b/app/modules/web/Controllers/ItemManager/IndexController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\ItemManager; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\Exceptions\ConstraintException; @@ -142,36 +142,36 @@ final class IndexController extends ControllerBase { $this->itemSearchData = new ItemSearchData(null, 0, $this->configData->getAccountCount()); - if ($this->checkAccess(ActionsInterface::CATEGORY)) { + if ($this->checkAccess(AclActionsInterface::CATEGORY)) { $this->tabsGridHelper->addTab($this->getCategoriesList()); } - if ($this->checkAccess(ActionsInterface::TAG)) { + if ($this->checkAccess(AclActionsInterface::TAG)) { $this->tabsGridHelper->addTab($this->getTagsList()); } - if ($this->checkAccess(ActionsInterface::CLIENT)) { + if ($this->checkAccess(AclActionsInterface::CLIENT)) { $this->tabsGridHelper->addTab($this->getClientsList()); } - if ($this->checkAccess(ActionsInterface::CUSTOMFIELD)) { + if ($this->checkAccess(AclActionsInterface::CUSTOMFIELD)) { $this->tabsGridHelper->addTab($this->getCustomFieldsList()); } if ($this->configData->isFilesEnabled() - && $this->checkAccess(ActionsInterface::FILE)) { + && $this->checkAccess(AclActionsInterface::FILE)) { $this->tabsGridHelper->addTab($this->getAccountFilesList()); } - if ($this->checkAccess(ActionsInterface::ACCOUNTMGR)) { + if ($this->checkAccess(AclActionsInterface::ACCOUNTMGR)) { $this->tabsGridHelper->addTab($this->getAccountsList()); } - if ($this->checkAccess(ActionsInterface::ACCOUNTMGR_HISTORY)) { + if ($this->checkAccess(AclActionsInterface::ACCOUNTMGR_HISTORY)) { $this->tabsGridHelper->addTab($this->getAccountsHistoryList()); } - if ($this->checkAccess(ActionsInterface::ITEMPRESET)) { + if ($this->checkAccess(AclActionsInterface::ITEMPRESET)) { $this->tabsGridHelper->addTab($this->getItemPresetList()); } @@ -181,7 +181,7 @@ final class IndexController extends ControllerBase ); $this->tabsGridHelper->renderTabs( - Acl::getActionRoute(ActionsInterface::ITEMS_MANAGE), + Acl::getActionRoute(AclActionsInterface::ITEMS_MANAGE), $this->request->analyzeInt('tabIndex', 0) ); diff --git a/app/modules/web/Controllers/ItemPreset/CreateController.php b/app/modules/web/Controllers/ItemPreset/CreateController.php index 514623e0..302e7911 100644 --- a/app/modules/web/Controllers/ItemPreset/CreateController.php +++ b/app/modules/web/Controllers/ItemPreset/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ItemPreset; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -48,7 +48,7 @@ final class CreateController extends ItemPresetViewBase public function createAction(...$args): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::ITEMPRESET_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::ITEMPRESET_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/ItemPreset/DeleteController.php b/app/modules/web/Controllers/ItemPreset/DeleteController.php index 19cccd32..64873196 100644 --- a/app/modules/web/Controllers/ItemPreset/DeleteController.php +++ b/app/modules/web/Controllers/ItemPreset/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ItemPreset; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -51,7 +51,7 @@ final class DeleteController extends ItemPresetSaveBase public function deleteAction(?int $id = null): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::ITEMPRESET_DELETE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::ITEMPRESET_DELETE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/ItemPreset/EditController.php b/app/modules/web/Controllers/ItemPreset/EditController.php index c0d3a79e..b69f63aa 100644 --- a/app/modules/web/Controllers/ItemPreset/EditController.php +++ b/app/modules/web/Controllers/ItemPreset/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ItemPreset; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -49,7 +49,7 @@ final class EditController extends ItemPresetViewBase public function editAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::ITEMPRESET_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::ITEMPRESET_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/ItemPreset/ItemPresetViewBase.php b/app/modules/web/Controllers/ItemPreset/ItemPresetViewBase.php index 8010c727..c4063b49 100644 --- a/app/modules/web/Controllers/ItemPreset/ItemPresetViewBase.php +++ b/app/modules/web/Controllers/ItemPreset/ItemPresetViewBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ItemPreset; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\InvalidArgumentException; @@ -103,7 +103,7 @@ abstract class ItemPresetViewBase extends ControllerBase } $this->view->assign('preset', $itemPresetData); - $this->view->assign('nextAction', Acl::getActionRoute(ActionsInterface::ACCESS_MANAGE)); + $this->view->assign('nextAction', Acl::getActionRoute(AclActionsInterface::ACCESS_MANAGE)); if ($this->view->isView === true) { $this->view->assign('disabled', 'disabled'); diff --git a/app/modules/web/Controllers/ItemPreset/SaveCreateController.php b/app/modules/web/Controllers/ItemPreset/SaveCreateController.php index a884f77a..0ad60082 100644 --- a/app/modules/web/Controllers/ItemPreset/SaveCreateController.php +++ b/app/modules/web/Controllers/ItemPreset/SaveCreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ItemPreset; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -47,14 +47,14 @@ final class SaveCreateController extends ItemPresetSaveBase public function saveCreateAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::ITEMPRESET_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::ITEMPRESET_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::ITEMPRESET_CREATE); + $this->form->validateFor(AclActionsInterface::ITEMPRESET_CREATE); $itemData = $this->form->getItemData(); diff --git a/app/modules/web/Controllers/ItemPreset/SaveEditController.php b/app/modules/web/Controllers/ItemPreset/SaveEditController.php index 2da64caf..4b89c331 100644 --- a/app/modules/web/Controllers/ItemPreset/SaveEditController.php +++ b/app/modules/web/Controllers/ItemPreset/SaveEditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\ItemPreset; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -51,14 +51,14 @@ final class SaveEditController extends ItemPresetSaveBase public function saveEditAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::ITEMPRESET_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::ITEMPRESET_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::ITEMPRESET_EDIT, $id); + $this->form->validateFor(AclActionsInterface::ITEMPRESET_EDIT, $id); $itemData = $this->form->getItemData(); diff --git a/app/modules/web/Controllers/ItemPreset/SearchController.php b/app/modules/web/Controllers/ItemPreset/SearchController.php index bb10c30d..4f58f98b 100644 --- a/app/modules/web/Controllers/ItemPreset/SearchController.php +++ b/app/modules/web/Controllers/ItemPreset/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\ItemPreset; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Html\DataGrid\DataGridInterface; use SP\Http\JsonResponse; @@ -70,7 +70,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::ITEMPRESET_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::ITEMPRESET_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/ItemPreset/ViewController.php b/app/modules/web/Controllers/ItemPreset/ViewController.php index ae5cda8c..8f2c631a 100644 --- a/app/modules/web/Controllers/ItemPreset/ViewController.php +++ b/app/modules/web/Controllers/ItemPreset/ViewController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\ItemPreset; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -51,7 +51,7 @@ final class ViewController extends ItemPresetViewBase public function viewAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::ITEMPRESET_VIEW)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::ITEMPRESET_VIEW)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Notification/CheckController.php b/app/modules/web/Controllers/Notification/CheckController.php index fe8eca6a..9db53a3d 100644 --- a/app/modules/web/Controllers/Notification/CheckController.php +++ b/app/modules/web/Controllers/Notification/CheckController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Notification; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -47,7 +47,7 @@ final class CheckController extends NotificationSaveBase public function checkAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::NOTIFICATION_CHECK)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::NOTIFICATION_CHECK)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Notification/CreateController.php b/app/modules/web/Controllers/Notification/CreateController.php index da7711a5..6ceff377 100644 --- a/app/modules/web/Controllers/Notification/CreateController.php +++ b/app/modules/web/Controllers/Notification/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Notification; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -45,7 +45,7 @@ final class CreateController extends NotificationViewBase public function createAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::NOTIFICATION_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::NOTIFICATION_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Notification/EditController.php b/app/modules/web/Controllers/Notification/EditController.php index 78834a03..3af09757 100644 --- a/app/modules/web/Controllers/Notification/EditController.php +++ b/app/modules/web/Controllers/Notification/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Notification; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -49,7 +49,7 @@ final class EditController extends NotificationViewBase public function editAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::NOTIFICATION_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::NOTIFICATION_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Notification/IndexController.php b/app/modules/web/Controllers/Notification/IndexController.php index e4957316..be4f0dfb 100644 --- a/app/modules/web/Controllers/Notification/IndexController.php +++ b/app/modules/web/Controllers/Notification/IndexController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Notification; use DI\DependencyException; use DI\NotFoundException; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; use SP\Core\Exceptions\SPException; @@ -52,7 +52,7 @@ final class IndexController extends ControllerBase */ public function indexAction(): void { - if (!$this->acl->checkUserAccess(ActionsInterface::NOTIFICATION)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::NOTIFICATION)) { return; } @@ -62,4 +62,4 @@ final class IndexController extends ControllerBase $this->view(); } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Notification/NotificationViewBase.php b/app/modules/web/Controllers/Notification/NotificationViewBase.php index a0e3d949..dc7e728e 100644 --- a/app/modules/web/Controllers/Notification/NotificationViewBase.php +++ b/app/modules/web/Controllers/Notification/NotificationViewBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Notification; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -87,7 +87,7 @@ abstract class NotificationViewBase extends ControllerBase ); } - $this->view->assign('nextAction', Acl::getActionRoute(ActionsInterface::NOTIFICATION)); + $this->view->assign('nextAction', Acl::getActionRoute(AclActionsInterface::NOTIFICATION)); if ($this->view->isView === true) { $this->view->assign('disabled', 'disabled'); diff --git a/app/modules/web/Controllers/Notification/SaveCreateController.php b/app/modules/web/Controllers/Notification/SaveCreateController.php index c0affb91..9756a7c5 100644 --- a/app/modules/web/Controllers/Notification/SaveCreateController.php +++ b/app/modules/web/Controllers/Notification/SaveCreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Notification; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -43,14 +43,14 @@ final class SaveCreateController extends NotificationSaveBase public function saveCreateAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::NOTIFICATION_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::NOTIFICATION_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::NOTIFICATION_CREATE); + $this->form->validateFor(AclActionsInterface::NOTIFICATION_CREATE); $this->notificationService->create($this->form->getItemData()); diff --git a/app/modules/web/Controllers/Notification/SaveEditController.php b/app/modules/web/Controllers/Notification/SaveEditController.php index d19d7233..d0deb364 100644 --- a/app/modules/web/Controllers/Notification/SaveEditController.php +++ b/app/modules/web/Controllers/Notification/SaveEditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Notification; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -50,14 +50,14 @@ final class SaveEditController extends NotificationSaveBase public function saveEditAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::NOTIFICATION_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::NOTIFICATION_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::NOTIFICATION_EDIT, $id); + $this->form->validateFor(AclActionsInterface::NOTIFICATION_EDIT, $id); $this->notificationService->update($this->form->getItemData()); diff --git a/app/modules/web/Controllers/Notification/SearchController.php b/app/modules/web/Controllers/Notification/SearchController.php index 9fe9ee16..ba01a627 100644 --- a/app/modules/web/Controllers/Notification/SearchController.php +++ b/app/modules/web/Controllers/Notification/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Notification; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Domain\Notification\Ports\NotificationServiceInterface; use SP\Html\DataGrid\DataGridInterface; @@ -68,7 +68,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::NOTIFICATION_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::NOTIFICATION_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Notification/ViewController.php b/app/modules/web/Controllers/Notification/ViewController.php index 1f2a1b6f..f82b2c0f 100644 --- a/app/modules/web/Controllers/Notification/ViewController.php +++ b/app/modules/web/Controllers/Notification/ViewController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Notification; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -49,7 +49,7 @@ final class ViewController extends NotificationViewBase public function viewAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::NOTIFICATION_VIEW)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::NOTIFICATION_VIEW)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Plugin/DeleteController.php b/app/modules/web/Controllers/Plugin/DeleteController.php index 1ff23f8d..926ba68d 100644 --- a/app/modules/web/Controllers/Plugin/DeleteController.php +++ b/app/modules/web/Controllers/Plugin/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Plugin; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Domain\Plugin\Ports\PluginServiceInterface; @@ -68,7 +68,7 @@ final class DeleteController extends ControllerBase public function deleteAction(?int $id = null): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PLUGIN_DELETE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PLUGIN_DELETE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Plugin/IndexController.php b/app/modules/web/Controllers/Plugin/IndexController.php index 61bebc46..c54f7556 100644 --- a/app/modules/web/Controllers/Plugin/IndexController.php +++ b/app/modules/web/Controllers/Plugin/IndexController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Controllers\Plugin; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; /** * Class IndexController @@ -41,7 +41,7 @@ final class IndexController extends PluginSearchBase */ public function indexAction(): void { - if (!$this->acl->checkUserAccess(ActionsInterface::PLUGIN)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PLUGIN)) { return; } @@ -51,4 +51,4 @@ final class IndexController extends PluginSearchBase $this->view(); } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Plugin/SearchController.php b/app/modules/web/Controllers/Plugin/SearchController.php index 98a398ce..51a4c458 100644 --- a/app/modules/web/Controllers/Plugin/SearchController.php +++ b/app/modules/web/Controllers/Plugin/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Plugin; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Http\JsonResponse; /** @@ -43,7 +43,7 @@ final class SearchController extends PluginSearchBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::PLUGIN_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PLUGIN_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') @@ -55,4 +55,4 @@ final class SearchController extends PluginSearchBase return $this->returnJsonResponseData(['html' => $this->render()]); } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/Plugin/ViewController.php b/app/modules/web/Controllers/Plugin/ViewController.php index 1bb83bd0..f204618d 100644 --- a/app/modules/web/Controllers/Plugin/ViewController.php +++ b/app/modules/web/Controllers/Plugin/ViewController.php @@ -27,7 +27,7 @@ namespace SP\Modules\Web\Controllers\Plugin; use Exception; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Domain\Plugin\Ports\PluginServiceInterface; @@ -73,7 +73,7 @@ final class ViewController extends ControllerBase public function viewAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PLUGIN_VIEW)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PLUGIN_VIEW)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') @@ -118,7 +118,7 @@ final class ViewController extends ControllerBase $this->view->assign('plugin', $pluginData); $this->view->assign('pluginInfo', $pluginInfo); - $this->view->assign('nextAction', Acl::getActionRoute(ActionsInterface::ITEMS_MANAGE)); + $this->view->assign('nextAction', Acl::getActionRoute(AclActionsInterface::ITEMS_MANAGE)); if ($this->view->isView === true) { $this->view->assign('disabled', 'disabled'); diff --git a/app/modules/web/Controllers/PublicLink/CreateController.php b/app/modules/web/Controllers/PublicLink/CreateController.php index da9757e8..63ceaaa7 100644 --- a/app/modules/web/Controllers/PublicLink/CreateController.php +++ b/app/modules/web/Controllers/PublicLink/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\PublicLink; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -45,7 +45,7 @@ final class CreateController extends PublicLinkViewBase public function createAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PUBLICLINK_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PUBLICLINK_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/PublicLink/DeleteController.php b/app/modules/web/Controllers/PublicLink/DeleteController.php index 807c4688..71644c35 100644 --- a/app/modules/web/Controllers/PublicLink/DeleteController.php +++ b/app/modules/web/Controllers/PublicLink/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\PublicLink; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -51,7 +51,7 @@ final class DeleteController extends PublicLinkSaveBase public function deleteAction(?int $id = null): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PUBLICLINK_DELETE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PUBLICLINK_DELETE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/PublicLink/EditController.php b/app/modules/web/Controllers/PublicLink/EditController.php index d96dc268..58f1e68e 100644 --- a/app/modules/web/Controllers/PublicLink/EditController.php +++ b/app/modules/web/Controllers/PublicLink/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\PublicLink; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -49,7 +49,7 @@ final class EditController extends PublicLinkViewBase public function editAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PUBLICLINK_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PUBLICLINK_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/PublicLink/PublicLinkController.php b/app/modules/web/Controllers/PublicLink/PublicLinkController.php index d71527cf..37434ba4 100644 --- a/app/modules/web/Controllers/PublicLink/PublicLinkController.php +++ b/app/modules/web/Controllers/PublicLink/PublicLinkController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\PublicLink; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -50,7 +50,7 @@ final class PublicLinkController extends PublicLinkViewBase public function viewAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PUBLICLINK_VIEW)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PUBLICLINK_VIEW)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/PublicLink/PublicLinkViewBase.php b/app/modules/web/Controllers/PublicLink/PublicLinkViewBase.php index d49bc1c2..8cc913ba 100644 --- a/app/modules/web/Controllers/PublicLink/PublicLinkViewBase.php +++ b/app/modules/web/Controllers/PublicLink/PublicLinkViewBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\PublicLink; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Bootstrap\BootstrapWeb; use SP\DataModel\PublicLinkListData; @@ -84,7 +84,7 @@ abstract class PublicLinkViewBase extends ControllerBase ->getItemsFromModelSelected([$publicLink->getItemId()]) ); - $this->view->assign('nextAction', Acl::getActionRoute(ActionsInterface::ACCESS_MANAGE)); + $this->view->assign('nextAction', Acl::getActionRoute(AclActionsInterface::ACCESS_MANAGE)); if ($this->view->isView === true) { $baseUrl = ($this->configData->getApplicationUrl() ?: BootstrapWeb::$WEBURI).BootstrapWeb::$SUBURI; diff --git a/app/modules/web/Controllers/PublicLink/RefreshController.php b/app/modules/web/Controllers/PublicLink/RefreshController.php index a3daef79..392ba6f8 100644 --- a/app/modules/web/Controllers/PublicLink/RefreshController.php +++ b/app/modules/web/Controllers/PublicLink/RefreshController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\PublicLink; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -49,7 +49,7 @@ final class RefreshController extends PublicLinkSaveBase public function refreshAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PUBLICLINK_REFRESH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PUBLICLINK_REFRESH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/PublicLink/SaveCreate.php b/app/modules/web/Controllers/PublicLink/SaveCreate.php index 09963640..3035bd4e 100644 --- a/app/modules/web/Controllers/PublicLink/SaveCreate.php +++ b/app/modules/web/Controllers/PublicLink/SaveCreate.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\PublicLink; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Exceptions\ValidationException; use SP\Http\JsonResponse; @@ -46,14 +46,14 @@ final class SaveCreate extends PublicLinkSaveBase public function saveCreateAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PUBLICLINK_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PUBLICLINK_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::PUBLICLINK_CREATE); + $this->form->validateFor(AclActionsInterface::PUBLICLINK_CREATE); $this->publicLinkService->create($this->form->getItemData()); diff --git a/app/modules/web/Controllers/PublicLink/SaveCreateFromAccountController.php b/app/modules/web/Controllers/PublicLink/SaveCreateFromAccountController.php index 0cb2ddb1..a34ef87d 100644 --- a/app/modules/web/Controllers/PublicLink/SaveCreateFromAccountController.php +++ b/app/modules/web/Controllers/PublicLink/SaveCreateFromAccountController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\PublicLink; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\DataModel\PublicLinkData; use SP\Domain\Account\Services\PublicLinkService; @@ -52,7 +52,7 @@ final class SaveCreateFromAccountController extends PublicLinkSaveBase public function saveCreateFromAccountAction(int $accountId, int $notify): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PUBLICLINK_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PUBLICLINK_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/PublicLink/SearchController.php b/app/modules/web/Controllers/PublicLink/SearchController.php index c149317c..57cb1533 100644 --- a/app/modules/web/Controllers/PublicLink/SearchController.php +++ b/app/modules/web/Controllers/PublicLink/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\PublicLink; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Domain\Account\Ports\PublicLinkServiceInterface; use SP\Html\DataGrid\DataGridInterface; @@ -70,7 +70,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::PUBLICLINK_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PUBLICLINK_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/SecurityManager/IndexController.php b/app/modules/web/Controllers/SecurityManager/IndexController.php index 3773b14c..20ff3a11 100644 --- a/app/modules/web/Controllers/SecurityManager/IndexController.php +++ b/app/modules/web/Controllers/SecurityManager/IndexController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\SecurityManager; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\Exceptions\ConstraintException; @@ -95,13 +95,13 @@ final class IndexController extends ControllerBase { $this->itemSearchData->setLimitCount($this->configData->getAccountCount()); - if ($this->checkAccess(ActionsInterface::EVENTLOG) + if ($this->checkAccess(AclActionsInterface::EVENTLOG) && $this->configData->isLogEnabled() ) { $this->tabsGridHelper->addTab($this->getEventlogList()); } - if ($this->checkAccess(ActionsInterface::TRACK)) { + if ($this->checkAccess(AclActionsInterface::TRACK)) { $this->tabsGridHelper->addTab($this->getTracksList()); } @@ -111,7 +111,7 @@ final class IndexController extends ControllerBase ); $this->tabsGridHelper->renderTabs( - Acl::getActionRoute(ActionsInterface::SECURITY_MANAGE), + Acl::getActionRoute(AclActionsInterface::SECURITY_MANAGE), $this->request->analyzeInt('tabIndex', 0) ); diff --git a/app/modules/web/Controllers/Tag/CreateController.php b/app/modules/web/Controllers/Tag/CreateController.php index 93727ebd..b40ef8c7 100644 --- a/app/modules/web/Controllers/Tag/CreateController.php +++ b/app/modules/web/Controllers/Tag/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Tag; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -45,7 +45,7 @@ final class CreateController extends TagViewBase public function createAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::TAG_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::TAG_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Tag/DeleteController.php b/app/modules/web/Controllers/Tag/DeleteController.php index 7f5a7f03..37db0988 100644 --- a/app/modules/web/Controllers/Tag/DeleteController.php +++ b/app/modules/web/Controllers/Tag/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Tag; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -50,7 +50,7 @@ final class DeleteController extends TagSaveBase public function deleteAction(?int $id = null): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::TAG_DELETE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::TAG_DELETE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') @@ -60,7 +60,7 @@ final class DeleteController extends TagSaveBase if ($id === null) { $this->tagService->deleteByIdBatch($this->getItemsIdFromRequest($this->request)); - $this->deleteCustomFieldsForItem(ActionsInterface::TAG, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::TAG, $id, $this->customFieldService); $this->eventDispatcher->notify('delete.tag.selection', new Event($this)); @@ -69,7 +69,7 @@ final class DeleteController extends TagSaveBase $this->tagService->delete($id); - $this->deleteCustomFieldsForItem(ActionsInterface::TAG, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::TAG, $id, $this->customFieldService); $this->eventDispatcher->notify('delete.tag', new Event($this)); diff --git a/app/modules/web/Controllers/Tag/EditController.php b/app/modules/web/Controllers/Tag/EditController.php index 65c80bf7..cbc8bba9 100644 --- a/app/modules/web/Controllers/Tag/EditController.php +++ b/app/modules/web/Controllers/Tag/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Tag; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -49,7 +49,7 @@ final class EditController extends TagViewBase public function editAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::TAG_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::TAG_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Tag/SaveCreateController.php b/app/modules/web/Controllers/Tag/SaveCreateController.php index 180de9e9..c02042cf 100644 --- a/app/modules/web/Controllers/Tag/SaveCreateController.php +++ b/app/modules/web/Controllers/Tag/SaveCreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Tag; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Exceptions\ValidationException; use SP\Http\JsonResponse; @@ -46,14 +46,14 @@ final class SaveCreateController extends TagSaveBase public function saveCreateAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::TAG_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::TAG_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::TAG_CREATE); + $this->form->validateFor(AclActionsInterface::TAG_CREATE); $this->tagService->create($this->form->getItemData()); diff --git a/app/modules/web/Controllers/Tag/SaveEditController.php b/app/modules/web/Controllers/Tag/SaveEditController.php index aab6efe2..76e1f02b 100644 --- a/app/modules/web/Controllers/Tag/SaveEditController.php +++ b/app/modules/web/Controllers/Tag/SaveEditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Tag; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Exceptions\ValidationException; use SP\Http\JsonResponse; @@ -50,14 +50,14 @@ final class SaveEditController extends TagSaveBase public function saveEditAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::TAG_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::TAG_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::TAG_EDIT, $id); + $this->form->validateFor(AclActionsInterface::TAG_EDIT, $id); $this->tagService->update($this->form->getItemData()); diff --git a/app/modules/web/Controllers/Tag/SearchController.php b/app/modules/web/Controllers/Tag/SearchController.php index dacff2c7..5adaf54e 100644 --- a/app/modules/web/Controllers/Tag/SearchController.php +++ b/app/modules/web/Controllers/Tag/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Tag; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Domain\Tag\Ports\TagServiceInterface; use SP\Html\DataGrid\DataGridInterface; @@ -70,7 +70,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::TAG_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::TAG_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Tag/TagViewBase.php b/app/modules/web/Controllers/Tag/TagViewBase.php index 85eafa3d..fc3c53b9 100644 --- a/app/modules/web/Controllers/Tag/TagViewBase.php +++ b/app/modules/web/Controllers/Tag/TagViewBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Tag; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -74,7 +74,7 @@ abstract class TagViewBase extends ControllerBase $this->view->assign('tag', $tag); - $this->view->assign('nextAction', Acl::getActionRoute(ActionsInterface::ITEMS_MANAGE)); + $this->view->assign('nextAction', Acl::getActionRoute(AclActionsInterface::ITEMS_MANAGE)); if ($this->view->isView === true) { $this->view->assign('disabled', 'disabled'); diff --git a/app/modules/web/Controllers/Tag/ViewController.php b/app/modules/web/Controllers/Tag/ViewController.php index 0685a8e0..e772248b 100644 --- a/app/modules/web/Controllers/Tag/ViewController.php +++ b/app/modules/web/Controllers/Tag/ViewController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Tag; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -50,7 +50,7 @@ final class ViewController extends TagViewBase public function viewAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::TAG_VIEW)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::TAG_VIEW)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/Track/ClearController.php b/app/modules/web/Controllers/Track/ClearController.php index e873c323..c954bf1d 100644 --- a/app/modules/web/Controllers/Track/ClearController.php +++ b/app/modules/web/Controllers/Track/ClearController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\Track; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedActionException; use SP\Core\Events\Event; use SP\Core\Exceptions\SPException; @@ -49,7 +49,7 @@ final class ClearController extends TrackBase public function clearAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::TRACK_CLEAR)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::TRACK_CLEAR)) { throw new UnauthorizedActionException(SPException::ERROR); } diff --git a/app/modules/web/Controllers/Track/SearchController.php b/app/modules/web/Controllers/Track/SearchController.php index 8e557020..362f7096 100644 --- a/app/modules/web/Controllers/Track/SearchController.php +++ b/app/modules/web/Controllers/Track/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Track; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedActionException; use SP\Core\Application; use SP\Core\Exceptions\SPException; @@ -72,7 +72,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::TRACK_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::TRACK_SEARCH)) { throw new UnauthorizedActionException(SPException::ERROR); } diff --git a/app/modules/web/Controllers/Track/UnlockController.php b/app/modules/web/Controllers/Track/UnlockController.php index cb91cc12..57ecbf3b 100644 --- a/app/modules/web/Controllers/Track/UnlockController.php +++ b/app/modules/web/Controllers/Track/UnlockController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\Track; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Acl\UnauthorizedActionException; use SP\Core\Events\Event; use SP\Core\Exceptions\SPException; @@ -52,7 +52,7 @@ final class UnlockController extends TrackBase public function unlockAction(int $id): ?bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::TRACK_UNLOCK)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::TRACK_UNLOCK)) { throw new UnauthorizedActionException(SPException::ERROR); } diff --git a/app/modules/web/Controllers/Upgrade/IndexController.php b/app/modules/web/Controllers/Upgrade/IndexController.php index ca7385b4..c75f83fc 100644 --- a/app/modules/web/Controllers/Upgrade/IndexController.php +++ b/app/modules/web/Controllers/Upgrade/IndexController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,6 +26,7 @@ namespace SP\Modules\Web\Controllers\Upgrade; use SP\Core\Acl\Actions; +use SP\Core\Acl\ActionsInterface; use SP\Core\Application; use SP\Modules\Web\Controllers\ControllerBase; use SP\Mvc\Controller\WebControllerHelper; @@ -37,7 +38,7 @@ final class IndexController extends ControllerBase { private Actions $actions; - public function __construct(Application $application, WebControllerHelper $webControllerHelper, Actions $actions) + public function __construct(Application $application, WebControllerHelper $webControllerHelper, ActionsInterface $actions) { parent::__construct($application, $webControllerHelper); @@ -57,4 +58,4 @@ final class IndexController extends ControllerBase $this->view(); } -} \ No newline at end of file +} diff --git a/app/modules/web/Controllers/User/CreateController.php b/app/modules/web/Controllers/User/CreateController.php index 7e8ebbdc..abc8f229 100644 --- a/app/modules/web/Controllers/User/CreateController.php +++ b/app/modules/web/Controllers/User/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\User; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -45,7 +45,7 @@ final class CreateController extends UserViewBase public function createAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::USER_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::USER_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/User/DeleteController.php b/app/modules/web/Controllers/User/DeleteController.php index 91d0ff9c..f17d0d55 100644 --- a/app/modules/web/Controllers/User/DeleteController.php +++ b/app/modules/web/Controllers/User/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\User; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -51,7 +51,7 @@ final class DeleteController extends UserSaveBase public function deleteAction(?int $id = null): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::USER_DELETE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::USER_DELETE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') @@ -71,14 +71,14 @@ final class DeleteController extends UserSaveBase ) ); - $this->deleteCustomFieldsForItem(ActionsInterface::USER, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::USER, $id, $this->customFieldService); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Users deleted')); } $this->userService->delete($id); - $this->deleteCustomFieldsForItem(ActionsInterface::USER, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::USER, $id, $this->customFieldService); $this->eventDispatcher->notify( 'delete.user', diff --git a/app/modules/web/Controllers/User/EditController.php b/app/modules/web/Controllers/User/EditController.php index b81e1391..91f55d80 100644 --- a/app/modules/web/Controllers/User/EditController.php +++ b/app/modules/web/Controllers/User/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\User; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -49,7 +49,7 @@ final class EditController extends UserViewBase public function editAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::USER_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::USER_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/User/EditPassController.php b/app/modules/web/Controllers/User/EditPassController.php index 0a0230cc..da866fcb 100644 --- a/app/modules/web/Controllers/User/EditPassController.php +++ b/app/modules/web/Controllers/User/EditPassController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\User; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\DataModel\UserData; use SP\Http\JsonResponse; @@ -51,7 +51,7 @@ final class EditPassController extends UserViewBase { try { // Comprobar si el usuario a modificar es distinto al de la sesión - if (!$this->acl->checkUserAccess(ActionsInterface::USER_EDIT_PASS, $id)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::USER_EDIT_PASS, $id)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/User/SaveCreateController.php b/app/modules/web/Controllers/User/SaveCreateController.php index 85e8a626..e8bfc8cb 100644 --- a/app/modules/web/Controllers/User/SaveCreateController.php +++ b/app/modules/web/Controllers/User/SaveCreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\User; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -48,14 +48,14 @@ final class SaveCreateController extends UserSaveBase public function saveCreateAction() { try { - if (!$this->acl->checkUserAccess(ActionsInterface::USER_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::USER_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::USER_CREATE); + $this->form->validateFor(AclActionsInterface::USER_CREATE); $itemData = $this->form->getItemData(); @@ -71,7 +71,7 @@ final class SaveCreateController extends UserSaveBase ) ); - $this->addCustomFieldsForItem(ActionsInterface::USER, $id, $this->request, $this->customFieldService); + $this->addCustomFieldsForItem(AclActionsInterface::USER, $id, $this->request, $this->customFieldService); $this->checkChangeUserPass($id, $itemData); diff --git a/app/modules/web/Controllers/User/SaveEditController.php b/app/modules/web/Controllers/User/SaveEditController.php index 9b0a5431..ac1bbc07 100644 --- a/app/modules/web/Controllers/User/SaveEditController.php +++ b/app/modules/web/Controllers/User/SaveEditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\User; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -52,14 +52,14 @@ final class SaveEditController extends UserSaveBase public function saveEditAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::USER_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::USER_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::USER_EDIT, $id); + $this->form->validateFor(AclActionsInterface::USER_EDIT, $id); $itemData = $this->form->getItemData(); @@ -76,7 +76,7 @@ final class SaveEditController extends UserSaveBase ) ); - $this->updateCustomFieldsForItem(ActionsInterface::USER, $id, $this->request, $this->customFieldService); + $this->updateCustomFieldsForItem(AclActionsInterface::USER, $id, $this->request, $this->customFieldService); $this->checkChangeUserPass($id, $itemData); diff --git a/app/modules/web/Controllers/User/SaveEditPassController.php b/app/modules/web/Controllers/User/SaveEditPassController.php index 5ce4c0c0..1281e683 100644 --- a/app/modules/web/Controllers/User/SaveEditPassController.php +++ b/app/modules/web/Controllers/User/SaveEditPassController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\User; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -51,14 +51,14 @@ final class SaveEditPassController extends UserSaveBase public function saveEditPassAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::USER_EDIT_PASS, $id)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::USER_EDIT_PASS, $id)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::USER_EDIT_PASS, $id); + $this->form->validateFor(AclActionsInterface::USER_EDIT_PASS, $id); $itemData = $this->form->getItemData(); diff --git a/app/modules/web/Controllers/User/SearchController.php b/app/modules/web/Controllers/User/SearchController.php index 596765ef..3e7d91dd 100644 --- a/app/modules/web/Controllers/User/SearchController.php +++ b/app/modules/web/Controllers/User/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\User; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Html\DataGrid\DataGridInterface; use SP\Http\JsonResponse; @@ -69,7 +69,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::USER_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::USER_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/User/UserViewBase.php b/app/modules/web/Controllers/User/UserViewBase.php index 777a2e63..028afa4c 100644 --- a/app/modules/web/Controllers/User/UserViewBase.php +++ b/app/modules/web/Controllers/User/UserViewBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\User; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\DataModel\UserData; use SP\Domain\CustomField\Ports\CustomFieldServiceInterface; @@ -101,7 +101,7 @@ abstract class UserViewBase extends ControllerBase ); $this->view->assign( 'nextAction', - Acl::getActionRoute(ActionsInterface::ACCESS_MANAGE) + Acl::getActionRoute(AclActionsInterface::ACCESS_MANAGE) ); if ($this->view->isView === true @@ -139,10 +139,10 @@ abstract class UserViewBase extends ControllerBase $this->view->assign('readonly', false); } - $this->view->assign('showViewCustomPass', $this->acl->checkUserAccess(ActionsInterface::CUSTOMFIELD_VIEW_PASS)); + $this->view->assign('showViewCustomPass', $this->acl->checkUserAccess(AclActionsInterface::CUSTOMFIELD_VIEW_PASS)); $this->view->assign( 'customFields', - $this->getCustomFieldsForItem(ActionsInterface::USER, $userId, $this->customFieldService) + $this->getCustomFieldsForItem(AclActionsInterface::USER, $userId, $this->customFieldService) ); } } diff --git a/app/modules/web/Controllers/User/ViewController.php b/app/modules/web/Controllers/User/ViewController.php index 2f87ddc9..5830a997 100644 --- a/app/modules/web/Controllers/User/ViewController.php +++ b/app/modules/web/Controllers/User/ViewController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\User; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -50,7 +50,7 @@ final class ViewController extends UserViewBase public function viewAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::USER_VIEW)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::USER_VIEW)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/UserGroup/CreateController.php b/app/modules/web/Controllers/UserGroup/CreateController.php index fdb52bce..ca739796 100644 --- a/app/modules/web/Controllers/UserGroup/CreateController.php +++ b/app/modules/web/Controllers/UserGroup/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\UserGroup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -45,7 +45,7 @@ final class CreateController extends UserGroupViewBase public function createAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::GROUP_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::GROUP_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/UserGroup/DeleteController.php b/app/modules/web/Controllers/UserGroup/DeleteController.php index da5f27c0..251a665a 100644 --- a/app/modules/web/Controllers/UserGroup/DeleteController.php +++ b/app/modules/web/Controllers/UserGroup/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\UserGroup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -51,7 +51,7 @@ final class DeleteController extends UserGroupSaveBase public function deleteAction(?int $id = null): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::GROUP_DELETE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::GROUP_DELETE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') @@ -66,7 +66,7 @@ final class DeleteController extends UserGroupSaveBase new Event($this, EventMessage::factory()->addDescription(__u('Groups deleted'))) ); - $this->deleteCustomFieldsForItem(ActionsInterface::GROUP, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::GROUP, $id, $this->customFieldService); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Groups deleted')); } @@ -84,7 +84,7 @@ final class DeleteController extends UserGroupSaveBase ) ); - $this->deleteCustomFieldsForItem(ActionsInterface::GROUP, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::GROUP, $id, $this->customFieldService); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Group deleted')); } catch (Exception $e) { diff --git a/app/modules/web/Controllers/UserGroup/EditController.php b/app/modules/web/Controllers/UserGroup/EditController.php index 8233f190..99be8ebd 100644 --- a/app/modules/web/Controllers/UserGroup/EditController.php +++ b/app/modules/web/Controllers/UserGroup/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\UserGroup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -49,7 +49,7 @@ final class EditController extends UserGroupViewBase public function editAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::GROUP_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::GROUP_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/UserGroup/SaveCreateController.php b/app/modules/web/Controllers/UserGroup/SaveCreateController.php index 2a3b0692..8485cd1e 100644 --- a/app/modules/web/Controllers/UserGroup/SaveCreateController.php +++ b/app/modules/web/Controllers/UserGroup/SaveCreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\UserGroup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -48,14 +48,14 @@ final class SaveCreateController extends UserGroupSaveBase public function saveCreateAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::GROUP_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::GROUP_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::GROUP_CREATE); + $this->form->validateFor(AclActionsInterface::GROUP_CREATE); $groupData = $this->form->getItemData(); @@ -71,7 +71,7 @@ final class SaveCreateController extends UserGroupSaveBase ) ); - $this->addCustomFieldsForItem(ActionsInterface::GROUP, $id, $this->request, $this->customFieldService); + $this->addCustomFieldsForItem(AclActionsInterface::GROUP, $id, $this->request, $this->customFieldService); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Group added')); } catch (ValidationException $e) { diff --git a/app/modules/web/Controllers/UserGroup/SaveEditController.php b/app/modules/web/Controllers/UserGroup/SaveEditController.php index ff7de325..022416c5 100644 --- a/app/modules/web/Controllers/UserGroup/SaveEditController.php +++ b/app/modules/web/Controllers/UserGroup/SaveEditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\UserGroup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -52,14 +52,14 @@ final class SaveEditController extends UserGroupSaveBase public function saveEditAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::GROUP_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::GROUP_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::GROUP_EDIT, $id); + $this->form->validateFor(AclActionsInterface::GROUP_EDIT, $id); $groupData = $this->form->getItemData(); @@ -76,7 +76,7 @@ final class SaveEditController extends UserGroupSaveBase ) ); - $this->updateCustomFieldsForItem(ActionsInterface::GROUP, $id, $this->request, $this->customFieldService); + $this->updateCustomFieldsForItem(AclActionsInterface::GROUP, $id, $this->request, $this->customFieldService); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Group updated')); } catch (ValidationException $e) { diff --git a/app/modules/web/Controllers/UserGroup/SearchController.php b/app/modules/web/Controllers/UserGroup/SearchController.php index 691a9413..e48b2c78 100644 --- a/app/modules/web/Controllers/UserGroup/SearchController.php +++ b/app/modules/web/Controllers/UserGroup/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\UserGroup; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Domain\User\Ports\UserGroupServiceInterface; use SP\Html\DataGrid\DataGridInterface; @@ -70,7 +70,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::GROUP_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::GROUP_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/UserGroup/UserGroupViewBase.php b/app/modules/web/Controllers/UserGroup/UserGroupViewBase.php index 88ae26ee..4fee6f82 100644 --- a/app/modules/web/Controllers/UserGroup/UserGroupViewBase.php +++ b/app/modules/web/Controllers/UserGroup/UserGroupViewBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\UserGroup; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\DataModel\UserGroupData; use SP\Domain\CustomField\Ports\CustomFieldServiceInterface; @@ -98,7 +98,7 @@ abstract class UserGroupViewBase extends ControllerBase : [] ); - $this->view->assign('nextAction', Acl::getActionRoute(ActionsInterface::ACCESS_MANAGE)); + $this->view->assign('nextAction', Acl::getActionRoute(AclActionsInterface::ACCESS_MANAGE)); if ($this->view->isView === true) { $this->view->assign('disabled', 'disabled'); @@ -108,10 +108,10 @@ abstract class UserGroupViewBase extends ControllerBase $this->view->assign('readonly', false); } - $this->view->assign('showViewCustomPass', $this->acl->checkUserAccess(ActionsInterface::CUSTOMFIELD_VIEW_PASS)); + $this->view->assign('showViewCustomPass', $this->acl->checkUserAccess(AclActionsInterface::CUSTOMFIELD_VIEW_PASS)); $this->view->assign( 'customFields', - $this->getCustomFieldsForItem(ActionsInterface::GROUP, $userGroupId, $this->customFieldService) + $this->getCustomFieldsForItem(AclActionsInterface::GROUP, $userGroupId, $this->customFieldService) ); } } diff --git a/app/modules/web/Controllers/UserGroup/ViewController.php b/app/modules/web/Controllers/UserGroup/ViewController.php index 55d9cdfd..cad5618f 100644 --- a/app/modules/web/Controllers/UserGroup/ViewController.php +++ b/app/modules/web/Controllers/UserGroup/ViewController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\UserGroup; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -50,7 +50,7 @@ final class ViewController extends UserGroupViewBase public function viewAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::GROUP_VIEW)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::GROUP_VIEW)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/UserProfile/CreateController.php b/app/modules/web/Controllers/UserProfile/CreateController.php index 41841f10..1d38bfb9 100644 --- a/app/modules/web/Controllers/UserProfile/CreateController.php +++ b/app/modules/web/Controllers/UserProfile/CreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\UserProfile; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -45,7 +45,7 @@ final class CreateController extends UserProfileViewBase public function createAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PROFILE_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PROFILE_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/UserProfile/DeleteController.php b/app/modules/web/Controllers/UserProfile/DeleteController.php index 9a25b805..e09c845b 100644 --- a/app/modules/web/Controllers/UserProfile/DeleteController.php +++ b/app/modules/web/Controllers/UserProfile/DeleteController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\UserProfile; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Http\JsonResponse; @@ -51,7 +51,7 @@ final class DeleteController extends UserProfileSaveBase public function deleteAction(?int $id = null): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PROFILE_DELETE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PROFILE_DELETE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') @@ -66,7 +66,7 @@ final class DeleteController extends UserProfileSaveBase new Event($this, EventMessage::factory()->addDescription(__u('Profiles deleted'))) ); - $this->deleteCustomFieldsForItem(ActionsInterface::PROFILE, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::PROFILE, $id, $this->customFieldService); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Profiles deleted')); } @@ -84,7 +84,7 @@ final class DeleteController extends UserProfileSaveBase ) ); - $this->deleteCustomFieldsForItem(ActionsInterface::PROFILE, $id, $this->customFieldService); + $this->deleteCustomFieldsForItem(AclActionsInterface::PROFILE, $id, $this->customFieldService); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Profile deleted')); } catch (Exception $e) { diff --git a/app/modules/web/Controllers/UserProfile/EditController.php b/app/modules/web/Controllers/UserProfile/EditController.php index a335fbfa..b4921e5b 100644 --- a/app/modules/web/Controllers/UserProfile/EditController.php +++ b/app/modules/web/Controllers/UserProfile/EditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\UserProfile; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -49,7 +49,7 @@ final class EditController extends UserProfileViewBase public function editAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PROFILE_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PROFILE_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/UserProfile/SaveCreateController.php b/app/modules/web/Controllers/UserProfile/SaveCreateController.php index 128208e7..f92983c5 100644 --- a/app/modules/web/Controllers/UserProfile/SaveCreateController.php +++ b/app/modules/web/Controllers/UserProfile/SaveCreateController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\UserProfile; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -48,14 +48,14 @@ final class SaveCreateController extends UserProfileSaveBase public function saveCreateAction(): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PROFILE_CREATE)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PROFILE_CREATE)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::PROFILE_CREATE); + $this->form->validateFor(AclActionsInterface::PROFILE_CREATE); $profileData = $this->form->getItemData(); @@ -71,7 +71,7 @@ final class SaveCreateController extends UserProfileSaveBase ) ); - $this->addCustomFieldsForItem(ActionsInterface::PROFILE, $id, $this->request, $this->customFieldService); + $this->addCustomFieldsForItem(AclActionsInterface::PROFILE, $id, $this->request, $this->customFieldService); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Profile added')); } catch (ValidationException $e) { diff --git a/app/modules/web/Controllers/UserProfile/SaveEditController.php b/app/modules/web/Controllers/UserProfile/SaveEditController.php index 847274d8..b5eee66e 100644 --- a/app/modules/web/Controllers/UserProfile/SaveEditController.php +++ b/app/modules/web/Controllers/UserProfile/SaveEditController.php @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\UserProfile; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Core\Events\EventMessage; use SP\Core\Exceptions\ValidationException; @@ -52,14 +52,14 @@ final class SaveEditController extends UserProfileSaveBase public function saveEditAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PROFILE_EDIT)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PROFILE_EDIT)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') ); } - $this->form->validateFor(ActionsInterface::PROFILE_EDIT, $id); + $this->form->validateFor(AclActionsInterface::PROFILE_EDIT, $id); $profileData = $this->form->getItemData(); @@ -76,7 +76,7 @@ final class SaveEditController extends UserProfileSaveBase ) ); - $this->updateCustomFieldsForItem(ActionsInterface::PROFILE, $id, $this->request, $this->customFieldService); + $this->updateCustomFieldsForItem(AclActionsInterface::PROFILE, $id, $this->request, $this->customFieldService); return $this->returnJsonResponse(JsonResponse::JSON_SUCCESS, __u('Profile updated')); } catch (ValidationException $e) { diff --git a/app/modules/web/Controllers/UserProfile/SearchController.php b/app/modules/web/Controllers/UserProfile/SearchController.php index 71a86bfb..3d04aef7 100644 --- a/app/modules/web/Controllers/UserProfile/SearchController.php +++ b/app/modules/web/Controllers/UserProfile/SearchController.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\UserProfile; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Domain\User\Ports\UserProfileServiceInterface; use SP\Html\DataGrid\DataGridInterface; @@ -70,7 +70,7 @@ final class SearchController extends ControllerBase */ public function searchAction(): bool { - if (!$this->acl->checkUserAccess(ActionsInterface::PROFILE_SEARCH)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PROFILE_SEARCH)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/UserProfile/UserProfileViewBase.php b/app/modules/web/Controllers/UserProfile/UserProfileViewBase.php index fde3df16..d560f035 100644 --- a/app/modules/web/Controllers/UserProfile/UserProfileViewBase.php +++ b/app/modules/web/Controllers/UserProfile/UserProfileViewBase.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -26,7 +26,7 @@ namespace SP\Modules\Web\Controllers\UserProfile; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\DataModel\ProfileData; use SP\DataModel\UserProfileData; @@ -82,7 +82,7 @@ abstract class UserProfileViewBase extends ControllerBase $this->view->assign('profile', $profile); $this->view->assign('profileData', $profile->getProfile() ?: new ProfileData()); - $this->view->assign('nextAction', Acl::getActionRoute(ActionsInterface::ACCESS_MANAGE)); + $this->view->assign('nextAction', Acl::getActionRoute(AclActionsInterface::ACCESS_MANAGE)); if ($this->view->isView === true) { $this->view->assign( @@ -99,10 +99,10 @@ abstract class UserProfileViewBase extends ControllerBase $this->view->assign('readonly', false); } - $this->view->assign('showViewCustomPass', $this->acl->checkUserAccess(ActionsInterface::CUSTOMFIELD_VIEW_PASS)); + $this->view->assign('showViewCustomPass', $this->acl->checkUserAccess(AclActionsInterface::CUSTOMFIELD_VIEW_PASS)); $this->view->assign( 'customFields', - $this->getCustomFieldsForItem(ActionsInterface::PROFILE, $profileId, $this->customFieldService) + $this->getCustomFieldsForItem(AclActionsInterface::PROFILE, $profileId, $this->customFieldService) ); } } diff --git a/app/modules/web/Controllers/UserProfile/ViewController.php b/app/modules/web/Controllers/UserProfile/ViewController.php index 7ee4bb89..a8a730b0 100644 --- a/app/modules/web/Controllers/UserProfile/ViewController.php +++ b/app/modules/web/Controllers/UserProfile/ViewController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\UserProfile; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Events\Event; use SP\Http\JsonResponse; use SP\Modules\Web\Controllers\Traits\JsonTrait; @@ -50,7 +50,7 @@ final class ViewController extends UserProfileViewBase public function viewAction(int $id): bool { try { - if (!$this->acl->checkUserAccess(ActionsInterface::PROFILE_VIEW)) { + if (!$this->acl->checkUserAccess(AclActionsInterface::PROFILE_VIEW)) { return $this->returnJsonResponse( JsonResponse::JSON_ERROR, __u('You don\'t have permission to do this operation') diff --git a/app/modules/web/Controllers/UserSettingsManager/IndexController.php b/app/modules/web/Controllers/UserSettingsManager/IndexController.php index aec6e4c5..e1d27c8c 100644 --- a/app/modules/web/Controllers/UserSettingsManager/IndexController.php +++ b/app/modules/web/Controllers/UserSettingsManager/IndexController.php @@ -25,7 +25,7 @@ namespace SP\Modules\Web\Controllers\UserSettingsManager; use SP\Core\Acl\Acl; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Events\Event; use SP\Core\Events\EventDispatcherInterface; @@ -75,7 +75,7 @@ final class IndexController extends ControllerBase implements ExtensibleTabContr $this->eventDispatcher->notify('show.userSettings', new Event($this)); $this->tabsHelper->renderTabs( - Acl::getActionRoute(ActionsInterface::USERSETTINGS), + Acl::getActionRoute(AclActionsInterface::USERSETTINGS), $this->request->analyzeInt('tabIndex', 0) ); diff --git a/app/modules/web/Forms/AccountForm.php b/app/modules/web/Forms/AccountForm.php index 1363f96d..05945827 100644 --- a/app/modules/web/Forms/AccountForm.php +++ b/app/modules/web/Forms/AccountForm.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Forms; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Application; use SP\Core\Exceptions\ValidationException; use SP\Domain\Account\Dtos\AccountCreateDto; @@ -71,7 +71,7 @@ final class AccountForm extends FormBase implements FormInterface $chain = new Chainable(fn() => $this->analyzeRequestData(), $this); switch ($action) { - case ActionsInterface::ACCOUNT_EDIT_PASS: + case AclActionsInterface::ACCOUNT_EDIT_PASS: $this->accountDto = $chain->next(fn(AccountDto $dto) => $this->checkPassword($dto)) ->next( fn(AccountDto $dto) => $this->accountPresetService->checkPasswordPreset( @@ -80,13 +80,13 @@ final class AccountForm extends FormBase implements FormInterface ) ->resolve(); break; - case ActionsInterface::ACCOUNT_EDIT: + case AclActionsInterface::ACCOUNT_EDIT: $this->accountDto = $chain->next(fn(AccountDto $dto) => $this->analyzeItems($dto)) ->next(fn(AccountDto $dto) => $this->checkCommon($dto)) ->resolve(); break; - case ActionsInterface::ACCOUNT_CREATE: - case ActionsInterface::ACCOUNT_COPY: + case AclActionsInterface::ACCOUNT_CREATE: + case AclActionsInterface::ACCOUNT_COPY: $this->accountDto = $chain->next(fn(AccountDto $dto) => $this->analyzeItems($dto)) ->next(fn(AccountDto $dto) => $this->checkCommon($dto)) ->next(fn(AccountDto $dto) => $this->checkPassword($dto)) @@ -97,7 +97,7 @@ final class AccountForm extends FormBase implements FormInterface ) ->resolve(); break; - case ActionsInterface::ACCOUNTMGR_BULK_EDIT: + case AclActionsInterface::ACCOUNTMGR_BULK_EDIT: $this->accountDto = $chain->next(fn(AccountDto $dto) => $this->analyzeItems($dto)) ->next(fn(AccountDto $dto) => $this->analyzeBulkEdit($dto)) ->resolve(); diff --git a/app/modules/web/Forms/AuthTokenForm.php b/app/modules/web/Forms/AuthTokenForm.php index d8219f68..51e1d992 100644 --- a/app/modules/web/Forms/AuthTokenForm.php +++ b/app/modules/web/Forms/AuthTokenForm.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Forms; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\ValidationException; use SP\DataModel\AuthTokenData; use SP\Domain\Auth\Services\AuthTokenService; @@ -55,8 +55,8 @@ final class AuthTokenForm extends FormBase implements FormInterface } switch ($action) { - case ActionsInterface::AUTHTOKEN_CREATE: - case ActionsInterface::AUTHTOKEN_EDIT: + case AclActionsInterface::AUTHTOKEN_CREATE: + case AclActionsInterface::AUTHTOKEN_EDIT: $this->analyzeRequestData(); $this->checkCommon(); break; @@ -110,4 +110,4 @@ final class AuthTokenForm extends FormBase implements FormInterface { return $this->authTokenData; } -} \ No newline at end of file +} diff --git a/app/modules/web/Forms/CategoryForm.php b/app/modules/web/Forms/CategoryForm.php index 4c06f099..dd734ed5 100644 --- a/app/modules/web/Forms/CategoryForm.php +++ b/app/modules/web/Forms/CategoryForm.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Forms; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\ValidationException; use SP\DataModel\CategoryData; @@ -53,8 +53,8 @@ final class CategoryForm extends FormBase implements FormInterface } switch ($action) { - case ActionsInterface::CATEGORY_CREATE: - case ActionsInterface::CATEGORY_EDIT: + case AclActionsInterface::CATEGORY_CREATE: + case AclActionsInterface::CATEGORY_EDIT: $this->analyzeRequestData(); $this->checkCommon(); break; @@ -90,4 +90,4 @@ final class CategoryForm extends FormBase implements FormInterface { return $this->categoryData; } -} \ No newline at end of file +} diff --git a/app/modules/web/Forms/ClientForm.php b/app/modules/web/Forms/ClientForm.php index 761422dc..6debcb93 100644 --- a/app/modules/web/Forms/ClientForm.php +++ b/app/modules/web/Forms/ClientForm.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Forms; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\ValidationException; use SP\DataModel\ClientData; @@ -53,8 +53,8 @@ final class ClientForm extends FormBase implements FormInterface } switch ($action) { - case ActionsInterface::CLIENT_CREATE: - case ActionsInterface::CLIENT_EDIT: + case AclActionsInterface::CLIENT_CREATE: + case AclActionsInterface::CLIENT_EDIT: $this->analyzeRequestData(); $this->checkCommon(); break; @@ -91,4 +91,4 @@ final class ClientForm extends FormBase implements FormInterface { return $this->clientData; } -} \ No newline at end of file +} diff --git a/app/modules/web/Forms/CustomFieldDefForm.php b/app/modules/web/Forms/CustomFieldDefForm.php index cda016ed..817b2cd1 100644 --- a/app/modules/web/Forms/CustomFieldDefForm.php +++ b/app/modules/web/Forms/CustomFieldDefForm.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Forms; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\ValidationException; use SP\DataModel\CustomFieldDefinitionData; @@ -53,8 +53,8 @@ final class CustomFieldDefForm extends FormBase implements FormInterface } switch ($action) { - case ActionsInterface::CUSTOMFIELD_CREATE: - case ActionsInterface::CUSTOMFIELD_EDIT: + case AclActionsInterface::CUSTOMFIELD_CREATE: + case AclActionsInterface::CUSTOMFIELD_EDIT: $this->analyzeRequestData(); $this->checkCommon(); break; @@ -102,4 +102,4 @@ final class CustomFieldDefForm extends FormBase implements FormInterface { return $this->customFieldDefData; } -} \ No newline at end of file +} diff --git a/app/modules/web/Forms/ItemsPresetForm.php b/app/modules/web/Forms/ItemsPresetForm.php index f89de672..cf531e4c 100644 --- a/app/modules/web/Forms/ItemsPresetForm.php +++ b/app/modules/web/Forms/ItemsPresetForm.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Forms; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\InvalidArgumentException; use SP\Core\Exceptions\ValidationException; use SP\DataModel\ItemPreset\AccountPermission; @@ -61,8 +61,8 @@ final class ItemsPresetForm extends FormBase implements FormInterface } switch ($action) { - case ActionsInterface::ITEMPRESET_CREATE: - case ActionsInterface::ITEMPRESET_EDIT: + case AclActionsInterface::ITEMPRESET_CREATE: + case AclActionsInterface::ITEMPRESET_EDIT: $this->analyzeRequestData(); $this->checkCommon(); break; diff --git a/app/modules/web/Forms/NotificationForm.php b/app/modules/web/Forms/NotificationForm.php index b4c51b9c..7aaebcae 100644 --- a/app/modules/web/Forms/NotificationForm.php +++ b/app/modules/web/Forms/NotificationForm.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Forms; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\ValidationException; use SP\Core\Messages\NotificationMessage; use SP\DataModel\NotificationData; @@ -54,8 +54,8 @@ final class NotificationForm extends FormBase implements FormInterface } switch ($action) { - case ActionsInterface::NOTIFICATION_CREATE: - case ActionsInterface::NOTIFICATION_EDIT: + case AclActionsInterface::NOTIFICATION_CREATE: + case AclActionsInterface::NOTIFICATION_EDIT: $this->analyzeRequestData(); $this->checkCommon(); break; @@ -117,4 +117,4 @@ final class NotificationForm extends FormBase implements FormInterface { return $this->notificationData; } -} \ No newline at end of file +} diff --git a/app/modules/web/Forms/PublicLinkForm.php b/app/modules/web/Forms/PublicLinkForm.php index fd2bdc9d..5e8d0b52 100644 --- a/app/modules/web/Forms/PublicLinkForm.php +++ b/app/modules/web/Forms/PublicLinkForm.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Forms; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\ValidationException; use SP\DataModel\PublicLinkData; use SP\Domain\Account\Services\PublicLinkService; @@ -54,8 +54,8 @@ final class PublicLinkForm extends FormBase implements FormInterface } switch ($action) { - case ActionsInterface::PUBLICLINK_CREATE: - case ActionsInterface::PUBLICLINK_EDIT: + case AclActionsInterface::PUBLICLINK_CREATE: + case AclActionsInterface::PUBLICLINK_EDIT: $this->analyzeRequestData(); $this->checkCommon(); break; @@ -92,4 +92,4 @@ final class PublicLinkForm extends FormBase implements FormInterface { return $this->publicLinkData; } -} \ No newline at end of file +} diff --git a/app/modules/web/Forms/TagForm.php b/app/modules/web/Forms/TagForm.php index 27d182c0..ed368ca7 100644 --- a/app/modules/web/Forms/TagForm.php +++ b/app/modules/web/Forms/TagForm.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Forms; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\ValidationException; use SP\DataModel\TagData; @@ -53,8 +53,8 @@ final class TagForm extends FormBase implements FormInterface } switch ($action) { - case ActionsInterface::TAG_CREATE: - case ActionsInterface::TAG_EDIT: + case AclActionsInterface::TAG_CREATE: + case AclActionsInterface::TAG_EDIT: $this->analyzeRequestData(); $this->checkCommon(); break; @@ -89,4 +89,4 @@ final class TagForm extends FormBase implements FormInterface { return $this->tagData; } -} \ No newline at end of file +} diff --git a/app/modules/web/Forms/UserForm.php b/app/modules/web/Forms/UserForm.php index 1dcb7ff6..090d2c77 100644 --- a/app/modules/web/Forms/UserForm.php +++ b/app/modules/web/Forms/UserForm.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Forms; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\SPException; use SP\Core\Exceptions\ValidationException; use SP\DataModel\UserData; @@ -55,20 +55,20 @@ final class UserForm extends FormBase implements FormInterface } switch ($action) { - case ActionsInterface::USER_CREATE: + case AclActionsInterface::USER_CREATE: $this->analyzeRequestData(); $this->checkCommon(); $this->checkPass(); break; - case ActionsInterface::USER_EDIT: + case AclActionsInterface::USER_EDIT: $this->analyzeRequestData(); $this->checkCommon(); break; - case ActionsInterface::USER_EDIT_PASS: + case AclActionsInterface::USER_EDIT_PASS: $this->analyzeRequestData(); $this->checkPass(); break; - case ActionsInterface::USER_DELETE: + case AclActionsInterface::USER_DELETE: $this->checkDelete(); break; } @@ -197,4 +197,4 @@ final class UserForm extends FormBase implements FormInterface { return $this->isLdap; } -} \ No newline at end of file +} diff --git a/app/modules/web/Forms/UserGroupForm.php b/app/modules/web/Forms/UserGroupForm.php index a7ce4eed..5a24a65a 100644 --- a/app/modules/web/Forms/UserGroupForm.php +++ b/app/modules/web/Forms/UserGroupForm.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Forms; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\SPException; use SP\Core\Exceptions\ValidationException; use SP\DataModel\UserGroupData; @@ -54,8 +54,8 @@ final class UserGroupForm extends FormBase implements FormInterface } switch ($action) { - case ActionsInterface::GROUP_CREATE: - case ActionsInterface::GROUP_EDIT: + case AclActionsInterface::GROUP_CREATE: + case AclActionsInterface::GROUP_EDIT: $this->analyzeRequestData(); $this->checkCommon(); break; @@ -99,4 +99,4 @@ final class UserGroupForm extends FormBase implements FormInterface return $this->groupData; } -} \ No newline at end of file +} diff --git a/app/modules/web/Forms/UserProfileForm.php b/app/modules/web/Forms/UserProfileForm.php index 40afeedc..9e93de43 100644 --- a/app/modules/web/Forms/UserProfileForm.php +++ b/app/modules/web/Forms/UserProfileForm.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -24,7 +24,7 @@ namespace SP\Modules\Web\Forms; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Exceptions\SPException; use SP\Core\Exceptions\ValidationException; use SP\DataModel\ProfileData; @@ -55,8 +55,8 @@ final class UserProfileForm extends FormBase implements FormInterface } switch ($action) { - case ActionsInterface::PROFILE_CREATE: - case ActionsInterface::PROFILE_EDIT: + case AclActionsInterface::PROFILE_CREATE: + case AclActionsInterface::PROFILE_EDIT: $this->analyzeRequestData(); $this->checkCommon(); break; @@ -141,4 +141,4 @@ final class UserProfileForm extends FormBase implements FormInterface return $this->userProfileData; } -} \ No newline at end of file +} diff --git a/app/modules/web/themes/material-blue/views/account/search-rows.inc b/app/modules/web/themes/material-blue/views/account/search-rows.inc index 662b0bd1..f4885983 100644 --- a/app/modules/web/themes/material-blue/views/account/search-rows.inc +++ b/app/modules/web/themes/material-blue/views/account/search-rows.inc @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -33,7 +33,7 @@ * @var AccountSearchItem $accountSearchItem */ -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\UI\ThemeIcons; use SP\Domain\Account\Services\AccountSearchItem; use SP\Html\DataGrid\Action\DataGridActionBase; @@ -291,7 +291,7 @@ $favoriteRouteOff = $_getvar('favoriteRouteOff'); getParamString('notes')); @@ -176,7 +176,7 @@ class ApiServiceTest extends DatabaseTestCase { self::$changeRequest->call($this, getResource('json', 'account_add.json')); - self::$service->setup(ActionsInterface::ACCOUNT_SEARCH); + self::$service->setup(AclActionsInterface::ACCOUNT_SEARCH); $this->assertEquals("bla bla bla\nbla bla~!?|.$%&/()=¿ªº€\"'", self::$service->getParamRaw('notes')); } @@ -189,7 +189,7 @@ class ApiServiceTest extends DatabaseTestCase { self::$changeRequest->call($this, getResource('json', 'account_search.json')); - self::$service->setup(ActionsInterface::ACCOUNT_SEARCH); + self::$service->setup(AclActionsInterface::ACCOUNT_SEARCH); $this->assertEquals(10, self::$service->getRequestId()); } diff --git a/tests/SP/Services/AuthToken/AuthTokenServiceTest.php b/tests/SP/Services/AuthToken/AuthTokenServiceTest.php index 83c57714..1c8cad34 100644 --- a/tests/SP/Services/AuthToken/AuthTokenServiceTest.php +++ b/tests/SP/Services/AuthToken/AuthTokenServiceTest.php @@ -1,10 +1,10 @@ . + * along with sysPass. If not, see . */ namespace SP\Tests\Services\AuthToken; @@ -29,7 +29,7 @@ use Defuse\Crypto\Exception\EnvironmentIsBrokenException; use DI\DependencyException; use DI\NotFoundException; use Exception; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Context\ContextException; use SP\Core\Crypt\Hash; use SP\Core\Crypt\Vault; @@ -119,7 +119,7 @@ class AuthTokenServiceTest extends DatabaseTestCase { $data = new AuthTokenData(); $data->setId(1); - $data->setActionId(ActionsInterface::ACCOUNT_CREATE); + $data->setActionId(AclActionsInterface::ACCOUNT_CREATE); $data->setCreatedBy(1); $data->setHash(self::AUTH_TOKEN_PASS); $data->setUserId(2); @@ -135,7 +135,7 @@ class AuthTokenServiceTest extends DatabaseTestCase $this->expectException(NoSuchItemException::class); $data->setId(10); - $data->setActionId(ActionsInterface::ACCOUNT_DELETE); + $data->setActionId(AclActionsInterface::ACCOUNT_DELETE); $this->assertEquals(0, self::$service->refreshAndUpdate($data)); } @@ -148,11 +148,11 @@ class AuthTokenServiceTest extends DatabaseTestCase */ public function testGetTokenByToken() { - $data = self::$service->getTokenByToken(ActionsInterface::ACCOUNT_VIEW_PASS, self::AUTH_TOKEN); + $data = self::$service->getTokenByToken(AclActionsInterface::ACCOUNT_VIEW_PASS, self::AUTH_TOKEN); $this->assertInstanceOf(AuthTokenData::class, $data); $this->assertEquals(2, $data->getId()); - $this->assertEquals(ActionsInterface::ACCOUNT_VIEW_PASS, $data->getActionId()); + $this->assertEquals(AclActionsInterface::ACCOUNT_VIEW_PASS, $data->getActionId()); $this->assertTrue(Hash::checkHashKey(self::AUTH_TOKEN_PASS, $data->getHash())); $this->assertNotEmpty($data->getVault()); @@ -176,17 +176,17 @@ class AuthTokenServiceTest extends DatabaseTestCase { $data = new AuthTokenData(); $data->setId(1); - $data->setActionId(ActionsInterface::ACCOUNT_CREATE); + $data->setActionId(AclActionsInterface::ACCOUNT_CREATE); $data->setCreatedBy(1); $data->setHash(self::AUTH_TOKEN_PASS); $data->setUserId(2); self::$service->update($data); - $data = self::$service->getTokenByToken(ActionsInterface::ACCOUNT_CREATE, $data->getToken()); + $data = self::$service->getTokenByToken(AclActionsInterface::ACCOUNT_CREATE, $data->getToken()); $this->assertInstanceOf(AuthTokenData::class, $data); - $this->assertEquals(ActionsInterface::ACCOUNT_CREATE, $data->getActionId()); + $this->assertEquals(AclActionsInterface::ACCOUNT_CREATE, $data->getActionId()); $this->assertTrue(Hash::checkHashKey(self::AUTH_TOKEN_PASS, $data->getHash())); $this->assertEquals(2, $data->getUserId()); @@ -213,7 +213,7 @@ class AuthTokenServiceTest extends DatabaseTestCase $this->assertInstanceOf(AuthTokenData::class, $data); $this->assertEquals(1, $data->getId()); - $this->assertEquals(ActionsInterface::ACCOUNT_SEARCH, $data->getActionId()); + $this->assertEquals(AclActionsInterface::ACCOUNT_SEARCH, $data->getActionId()); $this->assertEquals(pack('H*', '31326239303237643234656666663762666261636138626437373461346333346234356465333565303333643262313932613838663464666165653563323333'), $data->getToken()); $this->assertNull($data->getHash()); @@ -221,7 +221,7 @@ class AuthTokenServiceTest extends DatabaseTestCase $this->assertInstanceOf(AuthTokenData::class, $data); $this->assertEquals(2, $data->getId()); - $this->assertEquals(ActionsInterface::ACCOUNT_VIEW_PASS, $data->getActionId()); + $this->assertEquals(AclActionsInterface::ACCOUNT_VIEW_PASS, $data->getActionId()); $this->assertEquals(self::AUTH_TOKEN, $data->getToken()); $this->assertTrue(Hash::checkHashKey(self::AUTH_TOKEN_PASS, $data->getHash())); @@ -247,11 +247,11 @@ class AuthTokenServiceTest extends DatabaseTestCase $this->assertCount(4, $data); $this->assertInstanceOf(stdClass::class, $data[0]); - $this->assertEquals(ActionsInterface::ACCOUNT_SEARCH, $data[0]->actionId); + $this->assertEquals(AclActionsInterface::ACCOUNT_SEARCH, $data[0]->actionId); $this->assertEquals(self::AUTH_TOKEN, $data[0]->token); $this->assertInstanceOf(stdClass::class, $data[1]); - $this->assertEquals(ActionsInterface::ACCOUNT_VIEW, $data[1]->actionId); + $this->assertEquals(AclActionsInterface::ACCOUNT_VIEW, $data[1]->actionId); $this->assertEquals(self::AUTH_TOKEN, $data[1]->token); $itemSearchData = new ItemSearchData(); @@ -274,7 +274,7 @@ class AuthTokenServiceTest extends DatabaseTestCase public function testCreate() { $authTokenData = new AuthTokenData(); - $authTokenData->setActionId(ActionsInterface::ACCOUNT_CREATE); + $authTokenData->setActionId(AclActionsInterface::ACCOUNT_CREATE); $authTokenData->setCreatedBy(1); $authTokenData->setHash(self::AUTH_TOKEN_PASS); $authTokenData->setUserId(2); @@ -282,10 +282,10 @@ class AuthTokenServiceTest extends DatabaseTestCase $this->assertEquals(6, self::$service->create($authTokenData)); $this->assertEquals(6, self::getRowCount('AuthToken')); - $data = self::$service->getTokenByToken(ActionsInterface::ACCOUNT_CREATE, $authTokenData->getToken()); + $data = self::$service->getTokenByToken(AclActionsInterface::ACCOUNT_CREATE, $authTokenData->getToken()); $this->assertInstanceOf(AuthTokenData::class, $data); - $this->assertEquals(ActionsInterface::ACCOUNT_CREATE, $data->getActionId()); + $this->assertEquals(AclActionsInterface::ACCOUNT_CREATE, $data->getActionId()); $this->assertTrue(Hash::checkHashKey(self::AUTH_TOKEN_PASS, $data->getHash())); $this->assertEquals(6, $data->getId()); $this->assertEquals(2, $data->getUserId()); diff --git a/tests/SP/Services/CustomField/CustomFieldDefServiceTest.php b/tests/SP/Services/CustomField/CustomFieldDefServiceTest.php index 61bb0176..b9cec013 100644 --- a/tests/SP/Services/CustomField/CustomFieldDefServiceTest.php +++ b/tests/SP/Services/CustomField/CustomFieldDefServiceTest.php @@ -1,10 +1,10 @@ . + * along with sysPass. If not, see . */ namespace SP\Tests\Services\CustomField; use DI\DependencyException; use DI\NotFoundException; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Context\ContextException; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; @@ -99,7 +99,7 @@ class CustomFieldDefServiceTest extends DatabaseTestCase $expected->setName('Prueba'); $expected->setIsEncrypted(1); $expected->setHelp('Ayuda'); - $expected->setModuleId(ActionsInterface::ACCOUNT); + $expected->setModuleId(AclActionsInterface::ACCOUNT); $expected->setRequired(true); $expected->setTypeId(1); $expected->setShowInList(0); @@ -110,7 +110,7 @@ class CustomFieldDefServiceTest extends DatabaseTestCase $expected->setId(2); $expected->setName('RSA'); $expected->setIsEncrypted(0); - $expected->setModuleId(ActionsInterface::CATEGORY); + $expected->setModuleId(AclActionsInterface::CATEGORY); $expected->setRequired(false); $expected->setTypeId(2); $expected->setShowInList(0); @@ -151,7 +151,7 @@ class CustomFieldDefServiceTest extends DatabaseTestCase $data->setName('Phone'); $data->setIsEncrypted(0); $data->setHelp('Telefono'); - $data->setModuleId(ActionsInterface::ACCOUNT); + $data->setModuleId(AclActionsInterface::ACCOUNT); $data->setRequired(true); $data->setTypeId(6); $data->setShowInList(0); @@ -176,7 +176,7 @@ class CustomFieldDefServiceTest extends DatabaseTestCase $expected->setName('Prueba'); $expected->setIsEncrypted(1); $expected->setHelp('Ayuda'); - $expected->setModuleId(ActionsInterface::ACCOUNT); + $expected->setModuleId(AclActionsInterface::ACCOUNT); $expected->setRequired(true); $expected->setTypeId(1); $expected->setShowInList(0); @@ -201,7 +201,7 @@ class CustomFieldDefServiceTest extends DatabaseTestCase $data->setName('PIN'); $data->setIsEncrypted(0); $data->setHelp('Pin code'); - $data->setModuleId(ActionsInterface::CLIENT); + $data->setModuleId(AclActionsInterface::CLIENT); $data->setRequired(false); $data->setTypeId(2); $data->setShowInList(1); diff --git a/tests/SP/Services/CustomField/CustomFieldServiceTest.php b/tests/SP/Services/CustomField/CustomFieldServiceTest.php index 71342718..3941e3a7 100644 --- a/tests/SP/Services/CustomField/CustomFieldServiceTest.php +++ b/tests/SP/Services/CustomField/CustomFieldServiceTest.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -27,7 +27,7 @@ namespace SP\Tests\Services\CustomField; use Defuse\Crypto\Exception\CryptoException; use DI\DependencyException; use DI\NotFoundException; -use SP\Core\Acl\ActionsInterface; +use SP\Core\Acl\AclActionsInterface; use SP\Core\Context\ContextException; use SP\Core\Crypt\Crypt; use SP\Core\Exceptions\ConstraintException; @@ -124,15 +124,15 @@ class CustomFieldServiceTest extends DatabaseTestCase */ public function testDeleteCustomFieldDataBatch() { - $this->assertEquals(2, self::$service->deleteCustomFieldDataBatch([1, 2, 3], ActionsInterface::ACCOUNT)); + $this->assertEquals(2, self::$service->deleteCustomFieldDataBatch([1, 2, 3], AclActionsInterface::ACCOUNT)); - $this->assertEquals(1, self::$service->deleteCustomFieldDataBatch([1, 2, 3], ActionsInterface::CATEGORY)); + $this->assertEquals(1, self::$service->deleteCustomFieldDataBatch([1, 2, 3], AclActionsInterface::CATEGORY)); $this->assertEquals(0, self::getRowCount('CustomFieldData')); - $this->assertEquals(0, self::$service->deleteCustomFieldDataBatch([], ActionsInterface::CATEGORY)); + $this->assertEquals(0, self::$service->deleteCustomFieldDataBatch([], AclActionsInterface::CATEGORY)); - $this->assertEquals(0, self::$service->deleteCustomFieldDataBatch([], ActionsInterface::USER)); + $this->assertEquals(0, self::$service->deleteCustomFieldDataBatch([], AclActionsInterface::USER)); } /** @@ -145,7 +145,7 @@ class CustomFieldServiceTest extends DatabaseTestCase { $data = new CustomFieldData(); $data->setItemId(1); - $data->setModuleId(ActionsInterface::ACCOUNT); + $data->setModuleId(AclActionsInterface::ACCOUNT); $data->setDefinitionId(1); $data->setData('cuenta'); @@ -153,7 +153,7 @@ class CustomFieldServiceTest extends DatabaseTestCase $data = new CustomFieldData(); $data->setItemId(1); - $data->setModuleId(ActionsInterface::CATEGORY); + $data->setModuleId(AclActionsInterface::CATEGORY); $data->setDefinitionId(2); $data->setData('categoria'); @@ -161,7 +161,7 @@ class CustomFieldServiceTest extends DatabaseTestCase $data = new CustomFieldData(); $data->setItemId(2); - $data->setModuleId(ActionsInterface::ACCOUNT); + $data->setModuleId(AclActionsInterface::ACCOUNT); $data->setDefinitionId(1); $data->setData('cuenta'); @@ -169,7 +169,7 @@ class CustomFieldServiceTest extends DatabaseTestCase $data = new CustomFieldData(); $data->setItemId(2); - $data->setModuleId(ActionsInterface::CATEGORY); + $data->setModuleId(AclActionsInterface::CATEGORY); $data->setDefinitionId(2); $data->setData('categoria'); @@ -179,7 +179,7 @@ class CustomFieldServiceTest extends DatabaseTestCase $data = new CustomFieldData(); $data->setItemId(2); - $data->setModuleId(ActionsInterface::USER); + $data->setModuleId(AclActionsInterface::USER); $data->setDefinitionId(3); $data->setData('nan'); @@ -194,12 +194,12 @@ class CustomFieldServiceTest extends DatabaseTestCase */ public function testGetForModuleAndItemId() { - $result = self::$service->getForModuleAndItemId(ActionsInterface::ACCOUNT, 1); + $result = self::$service->getForModuleAndItemId(AclActionsInterface::ACCOUNT, 1); $this->assertCount(1, $result); $this->assertEquals('Prueba', $result[0]->definitionName); $this->assertEquals(1, $result[0]->definitionId); - $this->assertEquals(ActionsInterface::ACCOUNT, $result[0]->moduleId); + $this->assertEquals(AclActionsInterface::ACCOUNT, $result[0]->moduleId); $this->assertEquals(1, $result[0]->required); $this->assertEquals(0, $result[0]->showInList); $this->assertEquals('Ayuda', $result[0]->help); @@ -210,12 +210,12 @@ class CustomFieldServiceTest extends DatabaseTestCase $this->assertNotEmpty($result[0]->data); $this->assertNotEmpty($result[0]->key); - $result = self::$service->getForModuleAndItemId(ActionsInterface::ACCOUNT, 2); + $result = self::$service->getForModuleAndItemId(AclActionsInterface::ACCOUNT, 2); $this->assertCount(1, $result); $this->assertEquals('Prueba', $result[0]->definitionName); $this->assertEquals(1, $result[0]->definitionId); - $this->assertEquals(ActionsInterface::ACCOUNT, $result[0]->moduleId); + $this->assertEquals(AclActionsInterface::ACCOUNT, $result[0]->moduleId); $this->assertEquals(1, $result[0]->required); $this->assertEquals(0, $result[0]->showInList); $this->assertEquals('Ayuda', $result[0]->help); @@ -226,16 +226,16 @@ class CustomFieldServiceTest extends DatabaseTestCase $this->assertNotEmpty($result[0]->data); $this->assertNotEmpty($result[0]->key); - $result = self::$service->getForModuleAndItemId(ActionsInterface::ACCOUNT, 3); + $result = self::$service->getForModuleAndItemId(AclActionsInterface::ACCOUNT, 3); $this->assertCount(1, $result); - $result = self::$service->getForModuleAndItemId(ActionsInterface::CATEGORY, 1); + $result = self::$service->getForModuleAndItemId(AclActionsInterface::CATEGORY, 1); $this->assertCount(2, $result); $this->assertEquals('SSL', $result[0]->definitionName); $this->assertEquals(3, $result[0]->definitionId); - $this->assertEquals(ActionsInterface::CATEGORY, $result[0]->moduleId); + $this->assertEquals(AclActionsInterface::CATEGORY, $result[0]->moduleId); $this->assertEquals(0, $result[0]->required); $this->assertEquals(0, $result[0]->showInList); $this->assertEquals(null, $result[0]->help); @@ -248,7 +248,7 @@ class CustomFieldServiceTest extends DatabaseTestCase $this->assertEquals('RSA', $result[1]->definitionName); $this->assertEquals(2, $result[1]->definitionId); - $this->assertEquals(ActionsInterface::CATEGORY, $result[1]->moduleId); + $this->assertEquals(AclActionsInterface::CATEGORY, $result[1]->moduleId); $this->assertEquals(0, $result[1]->required); $this->assertEquals(0, $result[1]->showInList); $this->assertEquals(null, $result[1]->help); @@ -259,11 +259,11 @@ class CustomFieldServiceTest extends DatabaseTestCase $this->assertNotEmpty($result[1]->data); $this->assertNull($result[1]->key); - $result = self::$service->getForModuleAndItemId(ActionsInterface::CATEGORY, 2); + $result = self::$service->getForModuleAndItemId(AclActionsInterface::CATEGORY, 2); $this->assertEquals('SSL', $result[0]->definitionName); $this->assertEquals(3, $result[0]->definitionId); - $this->assertEquals(ActionsInterface::CATEGORY, $result[0]->moduleId); + $this->assertEquals(AclActionsInterface::CATEGORY, $result[0]->moduleId); $this->assertEquals(0, $result[0]->required); $this->assertEquals(0, $result[0]->showInList); $this->assertEquals(null, $result[0]->help); @@ -277,7 +277,7 @@ class CustomFieldServiceTest extends DatabaseTestCase $this->assertCount(2, $result); $this->assertEquals('RSA', $result[1]->definitionName); $this->assertEquals(2, $result[1]->definitionId); - $this->assertEquals(ActionsInterface::CATEGORY, $result[1]->moduleId); + $this->assertEquals(AclActionsInterface::CATEGORY, $result[1]->moduleId); $this->assertEquals(0, $result[1]->required); $this->assertEquals(0, $result[1]->showInList); $this->assertEquals(null, $result[1]->help); @@ -288,11 +288,11 @@ class CustomFieldServiceTest extends DatabaseTestCase $this->assertNull($result[1]->data); $this->assertNull($result[1]->key); - $result = self::$service->getForModuleAndItemId(ActionsInterface::CATEGORY, 3); + $result = self::$service->getForModuleAndItemId(AclActionsInterface::CATEGORY, 3); $this->assertCount(2, $result); - $result = self::$service->getForModuleAndItemId(ActionsInterface::USER, 1); + $result = self::$service->getForModuleAndItemId(AclActionsInterface::USER, 1); $this->assertCount(0, $result); } @@ -302,17 +302,17 @@ class CustomFieldServiceTest extends DatabaseTestCase */ public function testDeleteCustomFieldData() { - $this->assertEquals(1, self::$service->deleteCustomFieldData(1, ActionsInterface::ACCOUNT)); - $this->assertEquals(1, self::$service->deleteCustomFieldData(2, ActionsInterface::ACCOUNT)); - $this->assertEquals(1, self::$service->deleteCustomFieldData(1, ActionsInterface::CATEGORY)); + $this->assertEquals(1, self::$service->deleteCustomFieldData(1, AclActionsInterface::ACCOUNT)); + $this->assertEquals(1, self::$service->deleteCustomFieldData(2, AclActionsInterface::ACCOUNT)); + $this->assertEquals(1, self::$service->deleteCustomFieldData(1, AclActionsInterface::CATEGORY)); $this->assertEquals(0, self::getRowCount('CustomFieldData')); - $this->assertEquals(0, self::$service->deleteCustomFieldData(2, ActionsInterface::ACCOUNT)); + $this->assertEquals(0, self::$service->deleteCustomFieldData(2, AclActionsInterface::ACCOUNT)); - $this->assertEquals(0, self::$service->deleteCustomFieldData(2, ActionsInterface::CATEGORY)); + $this->assertEquals(0, self::$service->deleteCustomFieldData(2, AclActionsInterface::CATEGORY)); - $this->assertEquals(0, self::$service->deleteCustomFieldData(2, ActionsInterface::USER)); + $this->assertEquals(0, self::$service->deleteCustomFieldData(2, AclActionsInterface::USER)); } /** @@ -352,7 +352,7 @@ class CustomFieldServiceTest extends DatabaseTestCase { $data = new CustomFieldData(); $data->setId(2); - $data->setModuleId(ActionsInterface::ACCOUNT); + $data->setModuleId(AclActionsInterface::ACCOUNT); $data->setDefinitionId(1); $data->setData('cuenta'); $data->setKey('nan'); @@ -361,7 +361,7 @@ class CustomFieldServiceTest extends DatabaseTestCase $data = new CustomFieldData(); $data->setId(2); - $data->setModuleId(ActionsInterface::CATEGORY); + $data->setModuleId(AclActionsInterface::CATEGORY); $data->setDefinitionId(2); $data->setData('categoria'); $data->setKey('nan'); @@ -372,7 +372,7 @@ class CustomFieldServiceTest extends DatabaseTestCase $data = new CustomFieldData(); $data->setId(2); - $data->setModuleId(ActionsInterface::ACCOUNT); + $data->setModuleId(AclActionsInterface::ACCOUNT); $data->setDefinitionId(1); $data->setData('cuenta'); $data->setKey('nan'); @@ -385,7 +385,7 @@ class CustomFieldServiceTest extends DatabaseTestCase $data = new CustomFieldData(); $data->setId(2); - $data->setModuleId(ActionsInterface::CATEGORY); + $data->setModuleId(AclActionsInterface::CATEGORY); $data->setDefinitionId(2); $data->setData('categoria'); $data->setKey('nan');