margelatu

margelatu

Casnode 第 5 号会员,加入于 2020-07-13 23:12:14 +08:00
1 G 0 S 0 B
margelatu 的最新回复
5年前
回复了 margelatu 创建的主题 问与答 custom function in policy file

If i have in Model .conf like:

matchers m = eval(p.sub_rule) && r.obj == p.obj && r.act == p.act

then in policy file the following stuff works: p, my_custom_func(r.sub.Age), /data1, read

BUT not the following kind of stuff: p, my_custom_func(r.sub.Age,r.sub.MaxAge), /data1, read

....because the policy file is splitted by the ',' (COMMA) and my_custom_func takes 2 parameters ...so it will be 1 more extra comma in policy row

Casbin: " panic: invalid policy size: ...."

5年前
回复了 margelatu 创建的主题 问与答 custom function in policy file

I am trying to use ABAC in Casbin by getting User Atribbutes and Object Attributes and writing some custom functions to decide access allowed/deny but the policy file supports only some basic stuff like "p, r.sub.Age <60, /data2, write" . Does that mean I could end up without using only the Model .conf files ? so no central storage for the Model .conf files? Thanks,

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