implemented operation based permissions
This commit is contained in:
@@ -7,6 +7,16 @@ use Attribute;
|
||||
#[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_CLASS)]
|
||||
class AuthenticatedRoute
|
||||
{
|
||||
/**
|
||||
* @param string $path Route path
|
||||
* @param string $name Route name
|
||||
* @param array $methods HTTP methods
|
||||
* @param array $permissions Required permissions (OR logic - user needs ANY)
|
||||
* Examples:
|
||||
* - ['user.profile.edit'] - exact permission
|
||||
* - ['user_manager.users.*'] - wildcard permission
|
||||
* - ['user.edit.own', 'user.edit.any'] - multiple options
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $path,
|
||||
public readonly string $name,
|
||||
|
||||
Reference in New Issue
Block a user