Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 20 04:40
    harsimranb edited #354
  • Jan 19 00:27
    harsimranb opened #354
  • Jan 19 00:17
    hsluoyz commented #101
  • Jan 18 23:37
    harsimranb commented #101
  • Jan 15 08:44
    ErmakovDmitriy closed #352
  • Jan 13 01:46
    dialtone commented #353
  • Jan 13 01:45
    hsluoyz commented #353
  • Jan 13 01:41
    hsluoyz commented #353
  • Jan 13 01:37
    dialtone commented #353
  • Jan 13 01:35
    hsluoyz commented #353
  • Jan 13 00:59
    dialtone commented #353
  • Jan 13 00:32
    hsluoyz commented #353
  • Jan 12 16:01
    dialtone commented #353
  • Jan 12 15:58
    hsluoyz commented #353
  • Jan 12 15:56
    dialtone commented #353
  • Jan 12 15:54
    hsluoyz commented #353
  • Jan 12 15:52
    dialtone commented #353
  • Jan 12 14:56
    hsluoyz labeled #353
  • Jan 12 14:56
    hsluoyz assigned #353
  • Jan 12 14:56
    hsluoyz commented #353
Can't ASP.NET import Nuget package?
What about this, you send a GitHub issue
We have C# experts there to answer it
Let me see if he is here @huazhikui
Braden Groom
@bradengroom
Can someone help me understand the role definition functions? I see an example that has g(r.sub, p.sub, r.dom) as part of the matcher. What does this function actually do?
I think I understand things when you've only got two arguments there (g(r.sub, p.sub)), but it's not clear to me how things behave when you add more arguments
@bradengroom g is a built-in function for RBAC and RBAC with domains
Only 2 or 3 args are supported
mitesh-diligencevault
@mitesh-diligencevault
@hsluoyz i didn't start integrating yet, but was able to find the library. where can i find the tutorial for asp.net Integration? I'm planning to use it for asp.net web api 2.
Yang Luo
@hsluoyz
@mitesh-diligencevault can you send a GitHub issue?
Our C# guy is more responsive on GitHub
Zhikui Hua
@huazhikui
@mitesh-diligencevault please install Casbin.NET form the package source of nuget.org. https://www.nuget.org/packages/Casbin.NET/
mitesh-diligencevault
@mitesh-diligencevault
@huazhikui I've installed the library for the project. would like to see if you have any example.
Yang Luo
@hsluoyz
mitesh-diligencevault
@mitesh-diligencevault
@hsluoyz Thanks for the link, I will try to implement and let you know in case of any issue. I also would like you to create a test project for Web API 2.
mitesh-diligencevault
@mitesh-diligencevault
@hsluoyz How to load policies from DB for ASP.Net?
Yang Luo
@hsluoyz
See adapters
mitesh-diligencevault
@mitesh-diligencevault
@hsluoyz that's for asp.net core
Yang Luo
@hsluoyz
@mitesh-diligencevault is there any ORM for ASP.NET?
Entity Framework?
Is an adapter based on Entity Framework what you want?
@huazhikui
mitesh-diligencevault
@mitesh-diligencevault
Entity Framework & Entity Framework Core is a diff library, one is for ASP.NET classic & another is for ASP.Net Core
I'm looking at adapter implementation so I can add model & adapter based on need.
Yang Luo
@hsluoyz
Can you contribute one?
EF adapter
mitesh-diligencevault
@mitesh-diligencevault
Sure
Yang Luo
@hsluoyz
You can create a repo first. Like this one: https://github.com/casbin-net/EFCore-Adapter
I will put your adapter into casbin.org
when you're done
Thanks for contributing!
Dawlin Peña Luciano
@dluciano
Hi all happy new year, thanks for creating this amazing library
I am exploring the Casbin.NET and I would like to know if there is any example on how to use ABAC, thanks in advance
Yang Luo
@hsluoyz
Hi. Happy new year! See Go example: https://casbin.org/docs/en/abac
It should be similar to Rust
Dawlin Peña Luciano
@dluciano
Thanks. I read the documentation and I could make it work. However I added one condition to the matchers to validate that the user only can read objects from specific policy object

Basically, I have this in the *.conf file

r = sub, obj, act

[policy_definition]
p = sub, obj, act

[policy_effect]
e = some(where (p.eft == allow))

[matchers]
m = r.sub == r.obj.Owner && r.obj.Act == r.act

and this is the struct class

 public readonly struct CustomSecureABACResource
    {
        public CustomSecureABACResource(string owner, string name, string act)
        {
            Owner = owner;
            Name = name;
            Act = act;
        }
        public string Owner { get; }
        public string Name { get; }
        public string Act { get; }
    }

Finally, the challenge that call the enforcement is:
new Enforcer("models/custom_abac_model.conf") .Enforce(subject, resourcesPolicies, resource, act)

Dawlin Peña Luciano
@dluciano
I translated to English and will try to see if I make it work using .NET
Yang Luo
@hsluoyz
new Enforcer("models/custom_abac_model.conf") .Enforce(subject, resourcesPolicies, resource, act)
What's wrong with this call?
Dawlin Peña Luciano
@dluciano
Thanks, I solved the problem. Basically, I did not understand how the library works, but after reading the tutorial I could make it work. I am trying to implement custom functions using .NET now
Radu
@raduone
Hello, is there a documented and fully implemented version for the Web-UI ?
In the documentation I found this repository: https://github.com/casbin/web-ui
But the project seems to be only on the start phase.
Yang Luo
@hsluoyz
Radu
@raduone
I will try it ! Thank you @hsluoyz
Radu
@raduone

@hsluoyz I looked a bit on the code for the dashboard, I saw there is basically a management ui,
for the adapters, enforcers and policy models.

In the documentation I saw there is something like a UI in which you can manage policies.
From there I was directed to the web-ui repository that I mentioned.
Is something like this existing, is it also in the dashboard repository ?

Yang Luo
@hsluoyz
@raduone you can manage policies here: http://dashboard.casbin.org/adapter/adapter_1