diff --git a/README.md b/README.md index 9c8c8d1..6335eb6 100755 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ From where you have the `composer.json` file run `composer require evanshunt/ser Run `dev/build` -Then you can assign user groups the permission for `ServerInfoAccess` +Then you can assign user groups the permission for `Access Serverinfo` under `Other` category ## Changelog: - 2021-01-09: code cleanup diff --git a/code/ServerInfo.php b/code/ServerInfo.php index b89987a..ce2a14c 100644 --- a/code/ServerInfo.php +++ b/code/ServerInfo.php @@ -1,9 +1,7 @@ "Access Serverinfo", + ); + } + + public function canView($member = null) { + return Permission::check('CMS_ACCESS_ServerInfo', 'any', $member); } public function getinfo(){ - if ( Permission::check('ServerInfoAccess') ) { + if ( Permission::check('CMS_ACCESS_ServerInfo', 'any', Member::currentUser()) ) { ob_start(); phpinfo(); $info = ob_get_contents(); @@ -28,10 +29,4 @@ public function getinfo(){ } return NULL; } - -} - -class ServerInfoAccess extends ModelAdmin -{ - }