Skip to content

feat: add support for Value13 and Value14 properties in Casbin.NET 2.16.0#86

Merged
hsluoyz merged 2 commits into
masterfrom
copilot/add-value13-and-value14-columns
Oct 30, 2025
Merged

feat: add support for Value13 and Value14 properties in Casbin.NET 2.16.0#86
hsluoyz merged 2 commits into
masterfrom
copilot/add-value13-and-value14-columns

Conversation

Copilot AI commented Oct 30, 2025

Copy link
Copy Markdown
Contributor

Casbin.NET 2.16.0 added Value13 and Value14 properties to PersistPolicy. Users encountered errors when the adapter attempted to map these properties to non-existent database columns.

Changes

  • Updated Casbin.NET dependency from 2.7.0 to 2.16.0
  • Added Value13 and Value14 to ignored properties in DefaultPersistPolicyEntityTypeConfiguration.cs - these properties are not persisted, consistent with Value7-Value12
  • Fixed lambda type inference in SpecialPolicyTest.cs for compatibility with updated AddFunction API
  • Removed inaccessible MyGet package source from NuGet.config

Configuration Pattern

// Properties Value1-Value6 map to database columns v0-v5
builder.Property(p => p.Value1).HasColumnName("v0");
// ...
builder.Property(p => p.Value6).HasColumnName("v5");

// Properties Value7-Value14 are ignored (not persisted)
builder.Ignore(p => p.Value7);
// ...
builder.Ignore(p => p.Value14);  // ← Added

Users can now use standard 6-column casbin_rule table schema with latest Casbin.NET versions.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.myget.org
    • Triggering command: dotnet build (dns block)
    • Triggering command: dotnet build ./Casbin.Persist.Adapter.EFCore/Casbin.Persist.Adapter.EFCore.csproj --framework net8.0 (dns block)
    • Triggering command: dotnet build ./Casbin.Persist.Adapter.EFCore/Casbin.Persist.Adapter.EFCore.csproj --framework net8.0 -v minimal (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>casbin_rule table in my db needs to have Value13 and Value14 columns in it for this adapter to work</issue_title>
<issue_description>I am putting together a PoC app for Casbin using my SQL Server as my database for my policies. I created the casbin_rule table with the following columns as described in the Casbin Adapter documentation:

  • id int primary key
  • ptype varchar(10)
  • v0 varchar(50)
  • v1 varchar(50)
  • v2 varchar(50)
  • v3 varchar(50)
  • v4 varchar(50)
  • v5 varchar(50)

When I ran my app for the first time, I got an error that it was missing two columns named "Value13" and "Value14". I am assuming that they are probably additional columns added to the Casbin app and your adapter just needs to be updated to ignore those additional columns in the DefaultPersistPolicyEntityTypeConfiguration.cs file. When I added those columns the app ran fine but those columns were all nulls when I saved my policy.</issue_description>

Comments on the Issue (you are @copilot in this section)

@hsluoyz @sagilio @sociometry @AsakusaRinne @hsluoyz We need to add the Value13 and Value14 columns

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@hsluoyz

hsluoyz commented Oct 30, 2025

Copy link
Copy Markdown
Member

@sagilio please review

@hsluoyz hsluoyz requested a review from sagilio October 30, 2025 14:20
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@hsluoyz hsluoyz marked this pull request as ready for review October 30, 2025 14:26
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Value13 and Value14 columns to casbin_rule table Add support for Value13 and Value14 properties in Casbin.NET 2.16.0 Oct 30, 2025
Copilot AI requested a review from hsluoyz October 30, 2025 14:48
@hsluoyz hsluoyz changed the title Add support for Value13 and Value14 properties in Casbin.NET 2.16.0 feat: add support for Value13 and Value14 properties in Casbin.NET 2.16.0 Oct 30, 2025
@hsluoyz hsluoyz merged commit 5ebef73 into master Oct 30, 2025
8 of 11 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

thoraj pushed a commit to verji/efcore-adapter that referenced this pull request Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

casbin_rule table in my db needs to have Value13 and Value14 columns in it for this adapter to work

3 participants