Role
6 months ago
CapabilitiesProvider.php
3 months ago
Capability.php
6 months ago
Role.php
2 years ago
RolesProvider.php
1 year ago
Capability.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Matomo - free/libre analytics platform |
| 5 | * |
| 6 | * @link https://matomo.org |
| 7 | * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 8 | */ |
| 9 | namespace Piwik\Access; |
| 10 | |
| 11 | abstract class Capability |
| 12 | { |
| 13 | public abstract function getId() : string; |
| 14 | public abstract function getName() : string; |
| 15 | public abstract function getCategory() : string; |
| 16 | public abstract function getDescription() : string; |
| 17 | /** |
| 18 | * @return string[] |
| 19 | */ |
| 20 | public abstract function getIncludedInRoles() : array; |
| 21 | public function getHelpUrl() : string |
| 22 | { |
| 23 | return ''; |
| 24 | } |
| 25 | public function hasRoleCapability(string $idRole) : bool |
| 26 | { |
| 27 | return \in_array($idRole, $this->getIncludedInRoles(), \true); |
| 28 | } |
| 29 | } |
| 30 |