From 921de259fa441fb562aec701f0c8c14310f126e4 Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Sat, 9 May 2026 15:08:04 -0300 Subject: capability based permission manager --- include/PermissionsManager.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include/PermissionsManager.h') diff --git a/include/PermissionsManager.h b/include/PermissionsManager.h index 6d79642..65c00e5 100644 --- a/include/PermissionsManager.h +++ b/include/PermissionsManager.h @@ -14,6 +14,7 @@ namespace nt { /** + * @class Capability-based permission manager * @brief Evaluates connection claims and object permissions. * * Permission checks are intentionally separated from lookup. The object @@ -40,6 +41,30 @@ namespace nt * It is still undecided whether this should run on every attempt to get * hold of an object, since that might produce significant overhead. * + * Note that the permissions systems also rely on objects with capabilities, + * so imagining the case a view (ephemeral relation) is created based on + * 3 other stored relations, while you can access the view, you cannot directly + * access the other 3 relations. You need explicit permission to create a handle + * on the others. + * + * Here's an example tree: + * /system + * /multigroups + * /coffee_shop + * /relations + * /user {type : stored} + * /order {type : stored} + * /user_and_order {type : ephemeral; deps = [/system/multigroups/coffee_shop/relations/users, /system/multigroups/coffee_shop/relations/orders]} + * /users + * /peter + * /permissions + * /multigroups/coffee_shop/relations/user_and_order {descriptor : [read]} + * /paul + * /permissions + * /multigroups/coffee_shop/relations/user {descriptor : [write, read]} + * + * Meaning that `peter` has access to read the `user_and_order` ephemeral relation, but cannot open a handle on `user` and `order`. + * * @param object Object being accessed. * @param connection_context Connection metadata for the caller. * @return True when access is allowed. -- cgit v1.2.3