From 3eb85e56533cb37e9c8f54acf2c04f826930050a Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 7 Feb 2023 17:02:10 +1300 Subject: [PATCH] API Deprecate SecurityAdmin API --- code/GroupImportForm.php | 6 +++++- code/MemberImportForm.php | 6 +++++- code/SecurityAdmin.php | 41 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/code/GroupImportForm.php b/code/GroupImportForm.php index 437c73cbb..e0f524711 100644 --- a/code/GroupImportForm.php +++ b/code/GroupImportForm.php @@ -11,14 +11,15 @@ use SilverStripe\ORM\FieldType\DBField; use SilverStripe\Security\Group; use SilverStripe\Security\GroupCsvBulkLoader; +use SilverStripe\Dev\Deprecation; /** * Imports {@link Group} records by CSV upload, as defined in * {@link GroupCsvBulkLoader}. + * @deprecated 1.13.0 Will be removed without equivalent functionality to replace it */ class GroupImportForm extends Form { - /** * @var Group Optional group relation */ @@ -26,6 +27,9 @@ class GroupImportForm extends Form public function __construct($controller, $name, $fields = null, $actions = null, $validator = null) { + Deprecation::withNoReplacement(function () { + Deprecation::notice('1.13.0', 'Will be removed without equivalent functionality to replace it', Deprecation::SCOPE_CLASS); + }); if (!$fields) { $helpHtml = _t( __CLASS__ . '.Help1', diff --git a/code/MemberImportForm.php b/code/MemberImportForm.php index f12566aa6..cb09ffbbb 100644 --- a/code/MemberImportForm.php +++ b/code/MemberImportForm.php @@ -12,14 +12,15 @@ use SilverStripe\Forms\RequiredFields; use SilverStripe\Forms\Form; use SilverStripe\View\Requirements; +use SilverStripe\Dev\Deprecation; /** * Imports {@link Member} records by CSV upload, as defined in * {@link MemberCsvBulkLoader}. + * @deprecated 1.13.0 Will be removed without equivalent functionality to replace it */ class MemberImportForm extends Form { - /** * @var Group Optional group relation */ @@ -27,6 +28,9 @@ class MemberImportForm extends Form public function __construct($controller, $name, $fields = null, $actions = null, $validator = null) { + Deprecation::withNoReplacement(function () { + Deprecation::notice('1.13.0', 'Will be removed without equivalent functionality to replace it', Deprecation::SCOPE_CLASS); + }); if (!$fields) { $helpHtml = _t( __CLASS__ . '.Help1', diff --git a/code/SecurityAdmin.php b/code/SecurityAdmin.php index 0f2a89038..b033fdfea 100755 --- a/code/SecurityAdmin.php +++ b/code/SecurityAdmin.php @@ -7,6 +7,7 @@ use SilverStripe\Control\HTTPResponse; use SilverStripe\Core\Convert; use SilverStripe\Core\Injector\Injector; +use SilverStripe\Dev\Deprecation; use SilverStripe\Forms\FieldList; use SilverStripe\Forms\Form; use SilverStripe\Forms\GridField\GridField; @@ -30,6 +31,8 @@ /** * Security section of the CMS + * + * Note: In CMS 5 SecurityAdmin will extend ModelAdmin instead of LeftAndMain */ class SecurityAdmin extends LeftAndMain implements PermissionProvider { @@ -43,7 +46,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider private static $tree_class = Group::class; /** - * @deprecated 1.13.0 Do not use this options. + * @deprecated 1.13.0 Will be removed without equivalent functionality to replace it * @config */ private static $subitem_class = Member::class; @@ -68,9 +71,13 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider * * @param HTTPRequest $request * @return HTTPResponse + * @deprecated 1.13.0 Will be removed without equivalent functionality to replace it */ public function users($request) { + Deprecation::withNoReplacement(function () { + Deprecation::notice('1.13.0', 'Will be removed without equivalent functionality to replace it.'); + }); return $this->index($request); } @@ -79,9 +86,13 @@ public function users($request) * * @param HTTPRequest $request * @return HTTPResponse + * @deprecated 1.13.0 Will be removed without equivalent functionality to replace it */ public function groups($request) { + Deprecation::withNoReplacement(function () { + Deprecation::notice('1.13.0', 'Will be removed without equivalent functionality to replace it.'); + }); return $this->index($request); } @@ -90,9 +101,13 @@ public function groups($request) * * @param HTTPRequest $request * @return HTTPResponse + * @deprecated 1.13.0 Will be removed without equivalent functionality to replace it */ public function roles($request) { + Deprecation::withNoReplacement(function () { + Deprecation::notice('1.13.0', 'Will be removed without equivalent functionality to replace it.'); + }); return $this->index($request); } @@ -214,8 +229,14 @@ public function getEditForm($id = null, $fields = null) return $form; } + /** + * @deprecated 1.13.0 Will be removed without equivalent functionality to replace it + */ public function memberimport() { + Deprecation::withNoReplacement(function () { + Deprecation::notice('1.13.0', 'Will be removed without equivalent functionality to replace it.'); + }); Requirements::clear(); Requirements::javascript('silverstripe/admin: client/dist/js/vendor.js'); Requirements::javascript('silverstripe/admin: client/dist/js/MemberImportForm.js'); @@ -231,9 +252,13 @@ public function memberimport() * @see SecurityAdmin_MemberImportForm * * @return Form + * @deprecated 1.13.0 Will be removed without equivalent functionality to replace it */ public function MemberImportForm() { + Deprecation::withNoReplacement(function () { + Deprecation::notice('1.13.0', 'Will be removed without equivalent functionality to replace it.'); + }); if (!Permission::check('ADMIN')) { return null; } @@ -246,8 +271,14 @@ public function MemberImportForm() return $form; } + /** + * @deprecated 1.13.0 Will be removed without equivalent functionality to replace it + */ public function groupimport() { + Deprecation::withNoReplacement(function () { + Deprecation::notice('1.13.0', 'Will be removed without equivalent functionality to replace it.'); + }); Requirements::clear(); Requirements::javascript('silverstripe/admin: client/dist/js/vendor.js'); Requirements::javascript('silverstripe/admin: client/dist/js/MemberImportForm.js'); @@ -264,9 +295,13 @@ public function groupimport() * * @skipUpgrade * @return Form + * @deprecated 1.13.0 Will be removed without equivalent functionality to replace it */ public function GroupImportForm() { + Deprecation::withNoReplacement(function () { + Deprecation::notice('1.13.0', 'Will be removed without equivalent functionality to replace it.'); + }); if (!Permission::check('ADMIN')) { return null; } @@ -276,9 +311,13 @@ public function GroupImportForm() /** * Disable GridFieldDetailForm backlinks for this view, as its + * @deprecated 1.13.0 Will be removed without equivalent functionality to replace it */ public function Backlink() { + Deprecation::withNoReplacement(function () { + Deprecation::notice('1.13.0', 'Will be removed without equivalent functionality to replace it.'); + }); return false; }