承接 linkage/doctrine-row-level-security 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

linkage/doctrine-row-level-security

最新稳定版本:v2.0.0

Composer 安装命令:

composer require linkage/doctrine-row-level-security

包简介

README 文档

README

A package to provide projects with Doctrine ORM PostgreSQL's Row Level Security features.

Installation

  1. Install this package via composer.
composer require linkage/doctrine-row-level-security
  1. Add this package's EventSubscriber to your doctrine configuration

for Symfony:

# services.yaml
services:
    rls.subscriber:
        class: Linkage\DoctrineRowLevelSecurity\RowLevelSecurityListener
        tags:
            - { name: doctrine.event_subscriber, connection: default }

for laravel-doctrine/orm:

// config/doctrine.php
            'events'        => [
                'listeners'   => [],
                'subscribers' => [
                    Linkage\DoctrineRowLevelSecurity\RowLevelSecurityListener::class,
                ],
            ],

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.

统计信息

  • 总下载量: 8.2k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-30