Keagel
02/02/2026, 6:41 PMevent -> parent of instance
- instance -> parent of instance_team
- Permissions inherit top-down (e.g. event_owner ⇒ permissions on all instances and teams)
- Roles are currently predefined:
- admin (global)
- event_manager
- instance_manager
- team_manager
- team_user, invited_team_user, pending_team_user
- Each role maps to a fixed set of permissions
- Users with enough power can grant custom direct permissions instead of assigning a role
Things I'm unsure about:
1. Roles vs direct permissions vs IAM-style role bindings. I already have inheritance working via parent->permission. My main question is whether it's worth refactoring toward the IAM blog pattern (role + role_binding + intersection) only to support custom permission bundles, or if keeping predefined roles + direct permissions is reasonable
2. I want to guarantee that a user cannot grant a permission they themselves don't have. My understanding is that this can be enforced using explicit grant_* permissions checked by the application before writing relationships. Would you agree?
3. I also want to optionally support expiring permissions. Is native relationship expiration the preferred solution here, and is there anything I should know when mixing expiring direct grants with inherited permissions?
4. I've seen in the previous thread that having a global admin role unioned into many permissions can cause issues with LookupResources and that it can be solved with impersonation. Is this something that should be supported by a permission in the schema like can_impersonate?Keagel
02/02/2026, 6:42 PMJoey
02/02/2026, 7:05 PMuser | user with expiration to support either without it or with it
4. it can be, yes. In addition to global's causing LR issues, its also risky: if you accidentally grant global permission, now users can do anything. We only recommend supporting impersonation on, say, read-only perms for that reason. It should be noted IF your global admin role only has a few users, its fine for LRKeagel
02/02/2026, 10:24 PMwith expiration to most relations in my schema
4. it's likely that I'll be the only user with admin role for now but I don't see this growing past a few users, at least not anywhere in the near future
Can you look at this sample of my schema and tell me if this looks right to you? For example I'm using a lot of permissions as pass throughs to relations because of this warning:
Arrow event->owner under permission "event_owner" references relation "owner" on definition "event"; it is recommended to point to a permission (arrow-references-relation)
But I've since seen the IAM example on the playground and it has the same warnings. What's the downside of doing it that way?
https://cdn.discordapp.com/attachments/1467953111510552742/1468009150490611927/example.zed?ex=69890d0f&is=6987bb8f&hm=2eb05a049b2ab19ad516ad3d85d510b2de6086a1f349bd7c40513ecdc60daca3&Joey
02/02/2026, 10:25 PMJoey
02/02/2026, 10:25 PMJoey
02/02/2026, 10:25 PMJoey
02/02/2026, 10:25 PMpermission is_owner = ownerJoey
02/02/2026, 10:25 PMevent->is_ownerJoey
02/02/2026, 10:25 PMis_owner perm, you can easilyJoey
02/02/2026, 10:26 PMevent->ownerJoey
02/02/2026, 10:26 PMowner (since its a relation) and so if you then introduce is_owner down the road but forget to change one of the target typesJoey
02/02/2026, 10:26 PMJoey
02/02/2026, 10:26 PMKeagel
02/02/2026, 10:29 PMKeagel
02/02/2026, 10:29 PMJoey
02/02/2026, 10:37 PMJoey
02/02/2026, 10:37 PMpermission instance_event_owner = instance->event_owner
permission instance_event_manager = instance->event_manager
permission instance_manager = instance->is_managerJoey
02/02/2026, 10:37 PMpermission someperm = instance_event_owner + instance_event_manager + instance_managerJoey
02/02/2026, 10:37 PMinstance three timesJoey
02/02/2026, 10:37 PMJoey
02/02/2026, 10:37 PMJoey
02/02/2026, 10:38 PMpermission someperm = instance->owner_manager_or_event_managerJoey
02/02/2026, 10:38 PMJoey
02/02/2026, 10:38 PMinstance to be like... 1Joey
02/02/2026, 10:38 PMinstance_event_owner + instance_event_manager + instance_manager + team_event_owner + team_event_manager + is_manager (the shared ones)Joey
02/02/2026, 10:38 PMJoey
02/02/2026, 10:38 PMpermission shared = ...Joey
02/02/2026, 10:38 PMKeagel
02/02/2026, 10:46 PMpermission someperm = instance->owner_manager_or_event_manager for this one, that means in the instance definition I need a permission permission owner_manager_or_event_manager = event->owner + event->manager + is_manager, so I guess that also applies to the other permissions where the definition is walked multiple times?Keagel
02/02/2026, 10:47 PMJoey
02/02/2026, 11:10 PMKeagel
02/02/2026, 11:23 PMKeagel
02/02/2026, 11:25 PMyetitwo
02/02/2026, 11:42 PMyetitwo
02/02/2026, 11:42 PMyetitwo
02/02/2026, 11:42 PMKeagel
02/02/2026, 11:43 PMyetitwo
02/02/2026, 11:43 PMKeagel
02/02/2026, 11:43 PMyetitwo
02/02/2026, 11:44 PMyetitwo
02/02/2026, 11:44 PMKeagel
02/02/2026, 11:45 PMyetitwo
02/02/2026, 11:46 PMyetitwo
02/02/2026, 11:46 PMyetitwo
02/02/2026, 11:46 PMKeagel
02/02/2026, 11:48 PMyetitwo
02/02/2026, 11:53 PMyetitwo
02/02/2026, 11:54 PMyetitwo
02/02/2026, 11:54 PMKeagel
02/02/2026, 11:58 PMyetitwo
02/03/2026, 12:22 AMyetitwo
02/03/2026, 12:22 AMKeagel
02/03/2026, 12:30 AMyetitwo
02/03/2026, 12:30 AMKeagel
02/03/2026, 12:32 AMKeagel
02/03/2026, 12:32 AMyetitwo
02/03/2026, 12:40 AMyetitwo
02/13/2026, 8:28 PMKeagel
02/16/2026, 2:30 PMyetitwo
02/16/2026, 2:34 PMKeagel
02/16/2026, 2:35 PMyetitwo
02/16/2026, 2:36 PMKeagel
02/16/2026, 2:41 PMyetitwo
02/16/2026, 2:45 PMyetitwo
02/16/2026, 2:45 PMyetitwo
02/16/2026, 2:46 PMyetitwo
02/16/2026, 2:46 PMKeagel
02/16/2026, 2:51 PMyetitwo
02/16/2026, 2:54 PMKeagel
02/16/2026, 2:55 PMyetitwo
02/16/2026, 2:56 PMKeagel
02/16/2026, 2:56 PMyetitwo
02/16/2026, 2:56 PMyetitwo
02/16/2026, 2:56 PMyetitwo
02/16/2026, 2:56 PMyetitwo
02/16/2026, 2:57 PMKeagel
02/16/2026, 2:58 PMKeagel
02/16/2026, 2:58 PMyetitwo
02/16/2026, 2:59 PMKeagel
02/16/2026, 2:59 PMyetitwo
02/16/2026, 2:59 PMyetitwo
02/16/2026, 3:00 PMKeagel
02/16/2026, 3:00 PMyetitwo
02/16/2026, 3:00 PMyetitwo
02/16/2026, 3:00 PMKeagel
02/16/2026, 3:04 PMyetitwo
02/16/2026, 3:07 PM