Casbin Forum runs on Casnode, the open-source Discourse-style forum. Try the Casnode demo →
Casbin Forum
0

it was a very stupid mistake

i have this interanl concept of "role templates" which are made up of a few object / action pairs - and i decorate them with user context informaiton

but i was not copying the template array - so after the first user registered - subequent users were getting more perms than my polciy specified

RIP

lol

+       dest := make([][]string, len(policy))
        for i := 0; i < len(policy); i++ {
-               policy[i] = decoratePolicy(policy[i], user, guild)
+               dest[i] = decoratePolicy(policy[i], user, guild)
        }
-       return policy
+       return dest
 }

that correclty does what i meant to do

took me a while to figure it out 😛

0

I did figure it out and it was all on my eend - wooo woooo - casbin has been awesome to build against.

0

a bit more infomration - it seems that i may have a bug on my end and pretty much what is happening is when im generating policies to be saved - some infomration from the previous request is haniging around and curropting my policy string - ill keep digging !

0

I think I am missing someting about how casbin caches policies internally - and then in my implementation doing something wrong.