Files
laravel-manager/src/Support/Permission.php
T

24 lines
748 B
PHP

<?php
namespace IriksIT\Manager\Support;
/**
* One thing an account can be allowed to do. A group holds a list of these values;
* a module declares the ones it adds (Module::permissions()).
*/
final readonly class Permission
{
/**
* @param string $value `<module>.<action>`, also the name of the gate
* @param string $label what the group form says next to the tick box
* @param string $section the heading it is listed under
* @param list<string> $needs values this one is useless without; a group that gets this gets those too
*/
public function __construct(
public string $value,
public string $label,
public string $section,
public array $needs = [],
) {}
}