<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lee</title>
    <description>The latest articles on DEV Community by Lee (@leeqvip).</description>
    <link>https://dev.to/leeqvip</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4055867%2Fd9e04805-ea2e-4107-8b99-eb40e3512782.png</url>
      <title>DEV Community: Lee</title>
      <link>https://dev.to/leeqvip</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/leeqvip"/>
    <language>en</language>
    <item>
      <title>Yii-Permission 3.0 Released: Built for Yii 3.0</title>
      <dc:creator>Lee</dc:creator>
      <pubDate>Fri, 31 Jul 2026 02:56:27 +0000</pubDate>
      <link>https://dev.to/leeqvip/yii-permission-30-released-built-for-yii-30-2dei</link>
      <guid>https://dev.to/leeqvip/yii-permission-30-released-built-for-yii-30-2dei</guid>
      <description>&lt;p&gt;In modern web development and enterprise system architecture, a flexible and efficient access control system is the ultimate cornerstone of application security. As a powerful and high-performance open-source access control framework, &lt;strong&gt;Casbin&lt;/strong&gt; supports various access control models—including ACL, RBAC, and ABAC—and is widely adopted across multiple language ecosystems.&lt;/p&gt;

&lt;p&gt;As the official Casbin extension for the PHP Yii framework, &lt;strong&gt;&lt;code&gt;php-casbin/yii-permission&lt;/code&gt; officially launched its major v3.0.0 release on July 30, 2026.&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Embracing Yii 3.0's Standalone Component Ecosystem
&lt;/h3&gt;

&lt;p&gt;The core highlight of v3.0 lies in its full adaptation to the Yii 3.0 framework architecture. As Yii 3.0 transitions toward a modernized, highly componentized, and PSR-standard-compliant design, &lt;code&gt;yii-permission&lt;/code&gt; has undergone a complete architectural redesign—from low-level design to interface integration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Higher Minimum Environment Requirements:&lt;/strong&gt; The package now requires &lt;strong&gt;PHP 8.2+&lt;/strong&gt;, taking full advantage of the latest type system and strong typing to boost code robustness.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modern DI Container Configuration:&lt;/strong&gt; Upgraded configuration management powered by &lt;code&gt;yiisoft/config&lt;/code&gt; ensures that declaring and initializing the Casbin authorization engine aligns seamlessly with Yii 3.0 native standards.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Complete Decoupling: From Traditional Components to PSR-15 Middleware
&lt;/h3&gt;

&lt;p&gt;In the Yii 2.0 era, access control was largely dependent on controller-level behaviors or Application components. Following modern PHP web architecture trends, &lt;code&gt;yii-permission 3.0&lt;/code&gt; introduces &lt;strong&gt;PSR-15 standard HTTP middleware&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;EnforcerMiddleware&lt;/code&gt;&lt;/strong&gt;: Intercepts requests directly within the HTTP pipeline to execute Casbin model-based authorization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;RequestMiddleware&lt;/code&gt;&lt;/strong&gt;: Facilitates context preprocessing and extraction from incoming requests.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With PSR-15 middleware, authorization logic can be effortlessly attached to global request pipelines or specific route groups, significantly improving middleware reusability and execution efficiency.&lt;/p&gt;




&lt;h3&gt;
  
  
  Seamless Integration with Yiisoft Access Interface
&lt;/h3&gt;

&lt;p&gt;To deliver a consistent developer experience for Yii users, &lt;code&gt;yii-permission 3.0&lt;/code&gt; introduces a new &lt;code&gt;AccessChecker&lt;/code&gt; class implementing the &lt;code&gt;Yiisoft\Access\AccessCheckerInterface&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This allows developers to continue using Yii's native access-checking semantics:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Easily perform permission checks in controllers or services using the unified interface&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;can&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'article.update'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'article'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$article&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Permission granted: perform update operation&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Under the hood, authorization decisions are driven by Casbin's high-performance engine, while the application layer stays fully aligned with Yii standards—dramatically lowering the learning curve for project migrations and secondary development.&lt;/p&gt;




&lt;h3&gt;
  
  
  Key Updates Summary
&lt;/h3&gt;

&lt;p&gt;According to the official GitHub Release notes, here is a summary of the key features and breaking changes in &lt;strong&gt;v3.0.0&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Yii 3.0 Compatibility:&lt;/strong&gt; Full support for Yii 3.0's standalone component ecosystem and Dependency Injection (DI) standards.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Updated Requirements:&lt;/strong&gt; Requires PHP 8.2 or higher and Yii 3.0 framework packages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PSR-15 Middleware Architecture:&lt;/strong&gt; Introduced &lt;code&gt;EnforcerMiddleware&lt;/code&gt; and &lt;code&gt;RequestMiddleware&lt;/code&gt; to replace legacy controller components.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Native &lt;code&gt;AccessChecker&lt;/code&gt; Support:&lt;/strong&gt; Added the &lt;code&gt;AccessChecker&lt;/code&gt; class implementing &lt;code&gt;Yiisoft\Access\AccessCheckerInterface&lt;/code&gt;, seamlessly empowering &lt;code&gt;$user-&amp;gt;can()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration &amp;amp; CI Optimization:&lt;/strong&gt; Integrated &lt;code&gt;yiisoft/config&lt;/code&gt; for DI configuration management; updated GitHub Actions CI workflows, PHP testing matrices, and code coverage configurations.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Recommendation &amp;amp; Upgrade Advice
&lt;/h3&gt;

&lt;p&gt;If you are building a new project with &lt;strong&gt;PHP 8.2+ and Yii 3.0&lt;/strong&gt;, or planning to upgrade an existing application to Yii 3’s modern component stack, &lt;strong&gt;&lt;code&gt;php-casbin/yii-permission&lt;/code&gt; 3.0&lt;/strong&gt; is the premier access control solution.&lt;/p&gt;

&lt;p&gt;Whether you need simple RBAC for single-tenant systems, or complex, multi-tenant ABAC (Attribute-Based Access Control) for high-concurrency environments, it provides a clean, standardized, and high-performance security layer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/php-casbin/yii-permission" rel="noopener noreferrer"&gt;https://github.com/php-casbin/yii-permission&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>php</category>
      <category>yii</category>
      <category>security</category>
      <category>api</category>
    </item>
  </channel>
</rss>
