casbin-rs / sqlx-adapter

Asynchronous casbin adapter for mysql, postgres, sqlite based on sqlx-rs

Home Page:https://github.com/casbin/casbin-rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RbacApi::delete_user() does not remove grouping policy

bk138 opened this issue · comments

While adding a role to a user and then deleting the user works when using FileAdapter, it fails when using sqlx-adapter. I've prepared a minimal sample project here that shows the issue.

Steps to repro

  • Assign a role to a user via add_role_for_user()
  • Call delete_user()

Expected outcome

Actual outcome

  • 'g' policy is deleted when using FileAdapter, but not when using sqlx-adapter

Related

There was a similar issue for node-casbin: casbin/node-casbin#118

While adding a role to a user and then deleting the user works when using FileAdapter, it fails when using sqlx-adapter. I've prepared a minimal sample project here that shows the issue.

Steps to repro

  • Assign a role to a user via add_role_for_user()

  • Call delete_user()

Expected outcome

Actual outcome

  • 'g' policy is deleted when using FileAdapter, but not when using sqlx-adapter

Related

There was a similar issue for node-casbin: casbin/node-casbin#118

We are working on this