Completed
Push — master ( 3a6bc2...bdf328 )
by Conrad
01:56
created

src/Extensions/GroupExtension.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace AdvancedLearning\Oauth2Server\Extensions;
4
5
use AdvancedLearning\Oauth2Server\Models\Scope;
6
use SilverStripe\Forms\FieldList;
7
use SilverStripe\Forms\GridField\GridField;
8
use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor;
9
use SilverStripe\ORM\DataExtension;
10
11
/**
12
 * Optionally adds scopes to groups, allows checking permissions for a Member based on scopes.
13
 *
14
 * @package AdvancedLearning\Oauth2Server\Extensions
15
 */
16
class GroupExtension extends DataExtension
17
{
18
    private static $many_many = [
0 ignored issues
show
The property $many_many is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
19
        'Scopes' => Scope::class
20
    ];
21
22
    public function updateCMSFields(FieldList $fields)
23
    {
24
        $fields->addFieldToTab('Root.Oauth', GridField::create(
25
            'Scopes',
26
            'Scopes',
27
            $this->Scopes(),
28
            GridFieldConfig_RelationEditor::create()
29
        ));
30
    }
31
}