abichinger

Results 39 comments of abichinger

@hadarhaviv the first error I encountered is ``` the number of "_" in role definition should be at least 2 ``` To solve this error you need to correct your...

@hsluoyz renaming `SetNamedRoleMatcher` to `SetNamedRoleMatchingFunc` and removing the reserved word `Matcher` would probably lead to the following function definition: (first solution) ```go //drm is defaultrolemanager func (e *Enforcer) SetNamedRoleMatchingFunc(ptype string,...

@tangyang9464 Yes, I think [this solution](https://github.com/casbin/casbin/issues/1004#issuecomment-1126908159) should apply. I'm going to create a PR for this.

I thought of an edge case, which is very unlikely, but I thought I should mention it. A cached expression should be invalidated, if a function inside the `FunctionMap` is...

@hsluoyz no, the govaluate expression will just keep a reference to the function. I updated the example above to make it more clear.

> @abichinger How to monitor changes in functionMap, do you have any idea? @tangyang9464 at the moment, I can't think of of a simple thread safe solution to monitor the...

@timconinx looks like the error comes from [`builtin_operators.go:370`](https://github.com/casbin/casbin/blob/860d290f060d7ec69396dd13ff299b3f35f1882a/util/builtin_operators.go#L370). Making `memorized` a `sync.Map` or [`SyncLRUCache`](https://github.com/casbin/casbin/blob/860d290f060d7ec69396dd13ff299b3f35f1882a/util/util.go#L319) should resolve the error.

I think the problem is that the default role manager can't distinguish between pattern and plain strings. As a result the role manager will treat every string as a pattern,...

@timconinx Please make sure, that the PR title and commit messages follow the [Conventional Commits spec](https://www.conventionalcommits.org/en/v1.0.0/#summary) Otherwise it looks good to me.

We could add an additional parameter `fn` to `GetPermissionsForUserInDomain` to fix this issue. ```go type fieldIndexValues func(user string, domain string) (int, []string) // GetPermissionsForUserInDomain gets permissions for a user or...