order user roles and permissions (#1372)
This commit is contained in:
38
src/Model/PermissionSection.php
Normal file
38
src/Model/PermissionSection.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
class PermissionSection implements PermissionSectionInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $title;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $filter;
|
||||
|
||||
public function __construct(string $title, string $strposFilter)
|
||||
{
|
||||
$this->title = $title;
|
||||
$this->filter = $strposFilter;
|
||||
}
|
||||
|
||||
public function getTitle(): string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function filter(string $permission): bool
|
||||
{
|
||||
return strpos($permission, $this->filter) !== false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user