Skip to content

Commit

Permalink
fix: casbin migration
Browse files Browse the repository at this point in the history
failed to initialize rbac:
error creating rbac enforcer: invalid policy rule size: expected 6, got 5,
rule: [everyone database.kratos * deny true]

setting v5 as empty string didn't fix this.
Casbin probably still sees the row as 5 columns, so setting it as "na".

Policies formed from permissions table have a valid UUID for v5 and mission-control uses uuid.Validate() to filter them out.
  • Loading branch information
adityathebe authored and moshloop committed Jan 2, 2025
1 parent 3712291 commit 5b3a60f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion views/031_casbin_effect.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
UPDATE casbin_rule SET v3 = 'allow' WHERE ptype = 'p' and (v3 is null or v3 = '');

UPDATE casbin_rule SET v4 = 'true' WHERE ptype = 'p' and (v4 is null OR v4 = '');
UPDATE casbin_rule SET v4 = 'true' WHERE ptype = 'p' and (v4 is null OR v4 = '');

UPDATE casbin_rule SET v5 = 'na' WHERE ptype = 'p' and (v5 is null OR v5 = '');

0 comments on commit 5b3a60f

Please sign in to comment.