なんもわからん、PermissionとResourceがテーブルにある必要ないんじゃないか
ekuinox opened this issue · comments
ekuinox commented
AccessiblesにJSONで定義持たせたほうがいいじゃないのか
ekuinox commented
一生進まんぞこれ!
ekuinox commented
構想
User = {
roles: Role[]
}
Role = {
policies: Policy[]
}
Policy = {
priority: u32
accessible: Allowed | Denied
resources: ResourceId[]
permissions: Permission[]
}
ResourceId = [resourceType, resourceId]
Permission = String // dotted eg. foo.bar.*
Permission(self).get_parents() => String[] // eg. ["*", "foo.*", "foo.bar.*", "foo.bar.*"]
user {
roles: [
{
policies: [{
allowed: {
resources: [ResourceId("action", "11111")],
permissions: ["action.*"]
}
}]
}
]
}
ExecutableContext {
user: User
resources: [
[resourceId, ["action.invoke"]]
]
}
{ user, resources } = ExecutableContext()
// user は リソース resources[@][0: resourceId] に対する 権限 resources[@][1: permissions] を持っているか
ekuinox commented
#17 (comment)
PolicyからVecにしたいなあとは思うんですが、いうていらんかもしれん...
あとテストがコケてる...なんで...