Casbin = way to authorization
A place for Casbin developers and users
现在注册
已注册用户请  登录
主题样式选择
默认主题样式 ✅
知乎主题样式 
kickingbull
Casnode  ›  Casbin

Functions available for policy_effect definitions

  •  
  •  
    kickingbull · 5年前 · 40 次点击 
    这是一个创建于 1927 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Is there any documentation someone can point me to on defining the policy_effect in model files?

    In the various example model files there are some functions used (e.g. where, some, priority). Where can I find a list of the available functions that can be used as I couldn't find any documentation on them.

    Also, where can I find a list of the available attributes for the policy such as the p.eft that is used? Are there others that may be valuable to use in certain scenarios?

    40 次点击  ∙  1 人收藏  
      Tweet Weibo 忽略主题 
    3 条回复   2020-08-20 11:32:48 +08:00
    kickingbull
    kickingbull5年前

    Looking through the code I found the DefaultEffector class merge_effects() method that processes the policy_effect. Suprisingly from the code there is only 4 possible values for the policy_effect and they are specific strings and not actual code as I was expecting. The 4 possible values are:

    • "some(where (p_eft == allow))"
    • "!some(where (p_eft == deny))"
    • "some(where (p_eft == allow)) && !some(where (p_eft == deny))"
    • "priority(p_eft) || deny"
    00LT00
    00LT005年前

    I'm sorry to answer this question a little late. I think this will be of some help to you.

    关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   50 人在线   最高记录 50   ·     选择语言  ·     选择编辑器
    创意工作者们的社区
    World is powered by code
    VERSION: 6f2aea9 · 12ms · UTC 10:54 · PVG 18:54 · LAX 03:54 · JFK 06:54
    ♥ Do have faith in what you're doing.