Skip to content

Commit

Permalink
Merge pull request #2 from PlasticStudio/feature/member-check-fix
Browse files Browse the repository at this point in the history
Feature/member check fix
  • Loading branch information
ebakernz authored May 23, 2024
2 parents 0151693 + 2ac9cb0 commit 626741c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"email": "[email protected]"
}],
"require": {
"silverstripe/framework": "~4.0 || ^5"
"silverstripe/framework": "^4 || ^5"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 4 additions & 4 deletions src/extensions/MisdirectionAdminTestingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace nglasl\misdirection;

use SilverStripe\Core\Extension;
use SilverStripe\Security\Member;
use SilverStripe\Security\Security;
use SilverStripe\Security\Permission;
use SilverStripe\View\Requirements;

Expand All @@ -23,9 +23,9 @@ public function updateEditForm($form) {
Requirements::css('nglasl/silverstripe-misdirection: client/css/misdirection.css');

// Restrict this functionality to administrators.

$user = Member::currentUserID();
if(Permission::checkMember($user, 'ADMIN')) {
$member = Security::getCurrentUser();
if (Permission::checkMember($member, 'ADMIN')) {

$gridfield = $form->fields->items[0];
if(isset($gridfield)) {

Expand Down

0 comments on commit 626741c

Please sign in to comment.