We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I use everywhere enums for roles/resources/privileges in php 8.1. it's better for maintenance than strings.
enum Roles: string implements Role { case EDITOR = 'editor'; public function getRoleId(): string { return $this->value; } } enum Resources: string implements Resource { case ARTICLE = 'article'; public function getResourceId(): string { return $this->value; } } enum ArticlePrivilege: string // implements Privilege { case EDIT = 'edit'; }
only method isAllowed accepts Resource and Role objects
The text was updated successfully, but these errors were encountered:
I could prepare PR if it makes sense
Sorry, something went wrong.
No branches or pull requests
I use everywhere enums for roles/resources/privileges in php 8.1. it's better for maintenance than strings.
only method isAllowed accepts Resource and Role objects
Proposal
The text was updated successfully, but these errors were encountered: