You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Removing a member from an org leaves their policies on disabled projects and groups #1980
When a member, service user or group is removed from an organization, or a user is deleted, the policies of that principal in the org are supposed to be removed. Policies on disabled projects and disabled groups of the org are skipped. The principal keeps them.
Why
cascadeRemovePrincipal in core/membership/org.go sorts the principal's policies into org, project and group policies. It first builds sets of the org's project ids and group ids:
Both lists return only enabled rows when no state is set. A policy on a disabled project or group is not in either set, so it is never classified and never deleted.
Failure case
A user has a role on a project in the org.
The project is disabled.
The user is removed from the org, or the user is deleted.
The policy on the disabled project stays live, with its SpiceDB tuples.
If the project is enabled again, the removed user has access again.
The same applies to a disabled group.
Expected
The cascade covers disabled projects and groups. List them in every state, the same way the organization delete now does (list enabled and disabled separately). Add a test with a disabled project and a disabled group.
Notes
Same behavior on main today. It is not new.
Found while reviewing the organization soft delete work. The org delete itself is not affected, because it removes every child project and group first.
Fixed by #2049, now merged. Removing a member from an organization now also clears their policies and group memberships on disabled projects and groups.
Activity
AmanGIT07 commentedon Nov 17, 2026
Fixed by #2049, now merged. Removing a member from an organization now also clears their policies and group memberships on disabled projects and groups.