mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #8101 from creative-commoners/pulls/3.7/php53-compat
FIX PHP 5.3 compat for referencing $this in closures
This commit is contained in:
commit
cf8f12009f
@ -1062,7 +1062,7 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
|||||||
*
|
*
|
||||||
* @return int[] List of group IDs
|
* @return int[] List of group IDs
|
||||||
*/
|
*/
|
||||||
protected function disallowedGroups() {
|
public function disallowedGroups() {
|
||||||
// unless the current user is an admin already OR the logged in user is an admin
|
// unless the current user is an admin already OR the logged in user is an admin
|
||||||
if (Permission::check('ADMIN') || Permission::checkMember($this, 'ADMIN')) {
|
if (Permission::check('ADMIN') || Permission::checkMember($this, 'ADMIN')) {
|
||||||
return array();
|
return array();
|
||||||
@ -1486,7 +1486,7 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
|||||||
if(Permission::check('EDIT_PERMISSIONS')) {
|
if(Permission::check('EDIT_PERMISSIONS')) {
|
||||||
// Filter allowed groups
|
// Filter allowed groups
|
||||||
$groups = Group::get();
|
$groups = Group::get();
|
||||||
$disallowedGroupIDs = $this->disallowedGroups();
|
$disallowedGroupIDs = $self->disallowedGroups();
|
||||||
if ($disallowedGroupIDs) {
|
if ($disallowedGroupIDs) {
|
||||||
$groups = $groups->exclude('ID', $disallowedGroupIDs);
|
$groups = $groups->exclude('ID', $disallowedGroupIDs);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user