linkage / doctrine-row-level-security
Installs: 1 319
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 2
Requires
- php: >=8.2
- doctrine/dbal: ^3.0
- doctrine/orm: ^2.14
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.15
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2024-10-30 05:16:11 UTC
README
A package to provide projects with Doctrine ORM PostgreSQL's Row Level Security features.
Usage
Add "#[RowLevelSecurity]" attribute to your Entity associated with table under Row Level Security.
There are 3 required options for RowLevelSecurity attribute:
- name: a name for policy which should be attached to the table
- role: a name of role which should be attached to RowLevelSecurity users
- using: a sql clause which describes the role's access condition
Then you can use doctrine:migrations:diff or doctrine:schema:create command as usual. SQL to enable Row Level Security will appear in your migration files or be executed on schema creation.