Issues (26)

migrations/permissions.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 *
4
 * Topic Image Preview. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2020, Matt Friedman
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace vse\topicimagepreview\migrations;
12
13
class permissions extends \phpbb\db\migration\migration
0 ignored issues
show
The type phpbb\db\migration\migration was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
{
15
	/**
16
	 * @inheritdoc
17
	 */
18
	public function effectively_installed()
19
	{
20
		return $this->config->offsetExists('vse_tip_srt');
21
	}
22
23
	/**
24
	 * @inheritdoc
25
	 */
26
	public static function depends_on()
27
	{
28
		return ['\vse\topicimagepreview\migrations\install_tip'];
29
	}
30
31
	/**
32
	 * @inheritdoc
33
	 */
34
	public function update_data()
35
	{
36
		return [
37
			// Add new configs
38
			['config.add', ['vse_tip_srt', 1]],
39
			['config.add', ['vse_tip_pst', 1]],
40
41
			// Add permission
42
			['permission.add', ['f_vse_tip', false, 'f_list_topics']],
43
44
			// Unset permissions that may have been set by copying from f_list_topics
45
			['permission.permission_unset', ['ROLE_FORUM_BOT', 'f_vse_tip']],
46
			['permission.permission_unset', ['ROLE_FORUM_ONQUEUE', 'f_vse_tip']],
47
		];
48
	}
49
}
50