Util:Permissions

Source: permissions.ts:6

Permission utility functions for checking user access rights


Static Methods

canWrite( owners: Array.<OwnerAccess>, meId: string, ownerId: string, ): boolean

Check if user can WRITE to resources owned by ownerId

Parameters

  • owners (Array.<OwnerAccess>) — From $store.state.owners
  • meId (string) — Current user ID
  • ownerId (string) — Resource owner ID

Returns

  • boolean

canDelete( owners: Array.<OwnerAccess>, meId: string, ownerId: string, ): boolean

Check if user can DELETE resources owned by ownerId

Parameters

  • owners (Array.<OwnerAccess>) — From $store.state.owners
  • meId (string) — Current user ID
  • ownerId (string) — Resource owner ID

Returns

  • boolean

canRead( owners: Array.<OwnerAccess>, meId: string, ownerId: string, ): boolean

Check if user can READ resources owned by ownerId

Parameters

  • owners (Array.<OwnerAccess>) — From $store.state.owners
  • meId (string) — Current user ID
  • ownerId (string) — Resource owner ID

Returns

  • boolean