Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 15:10
    tangyang9464 commented #1040
  • 13:42
    tangyang9464 commented #1040
  • 13:39
    tangyang9464 synchronize #1040
  • 13:33
    tangyang9464 synchronize #1040
  • 12:55
    tangyang9464 synchronize #1040
  • 12:53
    tangyang9464 synchronize #1040
  • 12:46
    tangyang9464 synchronize #1040
  • 12:32
    tangyang9464 synchronize #1040
  • 12:24
    tangyang9464 synchronize #1040
  • Aug 12 12:40
    hsluoyz commented #1074
  • Aug 12 06:32
    casbin-bot commented #1074
  • Aug 12 06:32
    liuqiyu-community assigned #1074
  • Aug 12 06:32
    liuqiyu-community labeled #1074
  • Aug 12 06:32
    liuqiyu-community opened #1074
  • Aug 11 15:37
    hsluoyz commented #1065
  • Aug 11 15:37
    hsluoyz unlabeled #1062
  • Aug 11 15:37
    hsluoyz labeled #1062
  • Aug 11 15:37
    hsluoyz commented #1062
  • Aug 11 15:37
    hsluoyz closed #1062
  • Aug 11 15:23
    tangyang9464 commented #1062
Yang Luo
@hsluoyz
but it's doable
Shivansh Yadav
@Shivansh-yadav13
ok
Eric Hulburd
@erichulburd

Casbin 2.x Enforcer.enforce catches panics and returns a wrapped error. I’ve had a recurring issue with the following on earlier versions (2.6.x) of Casbin: panic: runtime error: index out of range [91] with length 91.

Since updating to the latest Casbin 2.42.x, I’ve not seen this issue. However, it would be very helpful to have the panic stack along with the topline message.

If a maintainer could take a look at the following, it would be appreciated: https://github.com/casbin/casbin/pull/985/files

1 reply
Dongwook Kim
@riccoon5_twitter
Hello! I have a question regarding License for using casbin. Is casbin free to use? I see "Pricing & Sales" on top menu in this website. What is the pricing options for Casbin?
Yang Luo
@hsluoyz
@riccoon5_twitter Casbin community version is free under Apache 2.0. If you are interested in Casbin Enterprise version, plz contact me in private channel
1 reply
Vivek
@vivek_daramwal_twitter
Hi Casbin team
I am evaluating casbin for implementing RBAC
Chris Charles
@ccharles

Hello, all. I'm confused by the frontend API.

All the examples include a user or visitor parameter, but neither the Go implementation nor the Node.js implementation appear to use that parameter. Both appear to look up and return all policies.

I see that a frontend_old.go file was added, and that module does seem to look up permissions for the specified user.

What is the intended behaviour here? Based on the function name CasbinJsGetPermissionForUser I'd expect this to be user-specific.

Why was an "old" module added to the Go implementation alongside the regular module? They appear to have different semantics.

1 reply
Yang Luo
@hsluoyz
@ccharles hi, please create a github issue
2 replies
Ayush Paharia
@ayushpaharia
I'm working on casbin-dashboard. I'm not getting any inputs. Where should I be looking? @hsluoyz ?
Yang Luo
@hsluoyz
@ayushpaharia replied
Ukeje Chukwuemeriwo Goodness
@Goodnessuc
Good day guys
I'm here for GSoD
Its my first time on this app, just incase I'm out of place
Sujit Baniya
@sujit-baniya
Hello
Need help on Casbin to check if user role is valid based on wildcard domain
I've a user with admin role
I've following setup
g, 1, admin, *
g, 2, standard-user, standard-user
wxq
@wxq0309
Hello everyone, I am currently using pycasbin, but from the response data, it is too slow
Is there something wrong with my writing?
adapter = casbin_sqlalchemy_adapter.Adapter(settings.SQLALCHEMY_DATABASE_URI, db_class=CasbinRule)
    enforcer = casbin.Enforcer(path_config.RBAC_CONF_PATH, adapter)
uid = str(user.id)
path = request.url.path
method = request.method
    if not user.is_admin:
        ...
    else:
        enforcer = self.get_casbin_enforcer()
        # sub, obj, act
        if not enforcer.enforce(uid, path, method):
            raise AuthorizationError(status_code=401)
Ori
@kenonit

Hi everyone, im checking if Casbin is worth using in a big oraganization where this module will be used a as primary authorization service.
im quite aware of its single table issue, and the things we need to consider when working with multiple replicas.

What Im not currently sure is the implementation and in terms of performance.
According to what im reading, it seems like there is a linear search of policies rather than using any relevant, more performant data structure like trees.

Could it be that the validations (using Enforcer.enforce function) are done linearly in O(n) complexity?
If not, could you elaborate on how this is done and what im missing?

Yang Luo
@hsluoyz
Hi @sujit-baniya @wxq0309 @kenonit plz ask on github
Vojta Ešner
@voytech-net
Hi all, I have a quick question regarding Casbin and REST. How would you approach a case where I have route in Casbin policy defined as: /workspaces/:id but since it is an app where each user will belong to a different workspace, they can't see each others workspaces. Is there another model I might use that would be more suitable? Or is there another solution to this such as: explicitly say /workspaces/1, /workspaces/2 etc?
Cheyi Lin
@CheyiLin
Hi, did anyone tried the way: (new enforcer + load filtered policy from db adapter) per request? Not sure that creating a new enforcer is a lightweight op or not, just want a simple approach to avoid complex caching, pooling or locking mechanism at the beginning. Thanks!
Pavan Sudheendra
@91pavan
Hi, is there any example of getting casbin to work as an external auth server with Envoy? I looked at this - https://github.com/casbin/envoy-authz, but I'm having a hard time converting that example so casbin external auth server can work with Istio
Yang Luo
@hsluoyz
@91pavan see the docs: https://casbin.org/docs/en/envoy
@CheyiLin creating enforcer is just creating a class object, you need to know how much time it takes to load the policy from DB, this is the big part
Anirudh Vyas
@AnirudhVyas
Hi there - Has anyone done LDAP RoleManager implementation for RBAC Casbin? I need to associate LDAP groups with Roles and seed that data for users by default in my usecase
Anirudh Vyas
@AnirudhVyas
kinda blows no one did. I will do a PR to the project, as I need it anyways
Yang Luo
@hsluoyz
@AnirudhVyas Not yet. You are welcome to contribute a LDAP role manager! Plz make a new repo like existing ones: https://casbin.org/docs/en/role-managers
Zak Z
@Z4k_Z_twitter
2345
Zak Z
@Z4k_Z_twitter
if not user.is_admin:
...
else:
enforcer = self.get_casbin_enforcer()
    # sub, obj, act
    if not enforcer.enforce(uid, path, method):
        raise AuthorizationError(status_code=401)
Subhasis Dasgupta
@dsubhasis
Hi, I'm new to this group. Can anyone help me understand how I could implement row-level security using the Casbin? I'm using fast-API and SQL ORM, and a Microsoft SQL server
jackj-ohn1
@jackj-ohn1
the model based on RBAC can't use some functions to identify the user's power, isn't it? please help me
I use "g , user,normal" in my csv file .However, the function HasRoleForUser("user","normal") return false
Shivansh Yadav
@Shivansh-yadav13
Screenshot from 2022-06-28 12-07-33.png
I suggest please remove this from node-casbin, it should not be there when rebasing
Yang Luo
@hsluoyz
@Shivansh-yadav13 good point, who add this? Can you do a git-blame?
which commit or PR
Shivansh Yadav
@Shivansh-yadav13
@hsluoyz it's this commit casbin/node-casbin@d84e343
adarsh-007
@adarsh-007
can we have a custom model for rbax
rbac
ale7canna
@ale7canna

Hi guys. We are evaluating the usage of Casbin in order to improve our authorization strategy.
We have a few use-cases already in mind, but we are struggling finding the right casbin setup in order not to have millions of policies.

Is this the right place to ask for help??
Thanks!

Yang Luo
@hsluoyz
@ale7canna take a look at: https://casbin.io/docs/performance
@adarsh-007 yes
ale7canna
@ale7canna
@hsluoyz thanks for your answer. We already had a look at the documentation and the performance page, too. Is there any way we can deepen our use case in order to get your help/hints? Should I open a github issue?
Yang Luo
@hsluoyz
@ale7canna sure
1 reply
Sujit Baniya
@sujit-baniya
Hello, Can anyone suggest me how to define model for user with following role structure.
user_id, domain_id, organization_id, role_id
19 replies