UserPermissions table

The UserPermissions table in the FitStack - V2 schema has 5 columns, keyed by Id, with 2 foreign keys to Users and Permissions.

Direct user grant, bypassing roles. C# class is `UserPermission`; the table is `UserPermissions`. **Missing dimensions, by design:** there is no subject ("on whose data"), no expiry, and no revocation record — only `GrantedAt`. Adding those here would make one table mean two different things, so scoped coach access lives in its own tables. Also missing: a unique index on `(UserId, PermissionId)`, so the same grant can be inserted twice.

Columns (5)

Columns of the UserPermissions table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
UserIdtextnot null, references Users.Id
PermissionIduuidnot null, references Permissions.Id
GrantedAttimestamp with time zonenot null
GrantedBytextGranting user id. Deliberately NOT an FK today.

Indexes (2)

  • (UserId) (IX_UserPermissions_UserId)
  • (PermissionId) (IX_UserPermissions_PermissionId)

Relationships