1 | <?php |
||
2 | |||
3 | namespace LeKoala\DevToolkit\Tasks; |
||
4 | |||
5 | use SilverStripe\ORM\DB; |
||
6 | use SilverStripe\Dev\BuildTask; |
||
7 | use SilverStripe\Security\Group; |
||
8 | use LeKoala\DevToolkit\BuildTaskTools; |
||
9 | use SilverStripe\Security\Permission; |
||
10 | use SilverStripe\Subsites\Model\Subsite; |
||
0 ignored issues
–
show
|
|||
11 | |||
12 | /** |
||
13 | * @author LeKoala <[email protected]> |
||
14 | */ |
||
15 | class RemoveOldPermissionsTask extends BuildTask |
||
16 | { |
||
17 | use BuildTaskTools; |
||
18 | |||
19 | protected $title = "Remove 'other' permissions from the cms"; |
||
20 | private static $segment = 'RemoveOldPermissionsTask'; |
||
0 ignored issues
–
show
|
|||
21 | |||
22 | public function run($request) |
||
23 | { |
||
24 | $this->request = $request; |
||
25 | |||
26 | $permissions = Permission::get_codes(true); |
||
27 | |||
28 | $other = $permissions['Other']; |
||
29 | foreach ($other as $k => $infos) { |
||
30 | DB::prepared_query("DELETE FROM Permission WHERE Code = ?", [$k]); |
||
31 | DB::alteration_message("Deleting $k"); |
||
32 | } |
||
33 | |||
34 | DB::alteration_message('All done!'); |
||
35 | } |
||
36 | } |
||
37 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths