assertSelfScope function

void assertSelfScope(
  1. UserContext ctx,
  2. String ownerId
)

Implementation

void assertSelfScope(UserContext ctx, String ownerId) {
  if (ctx.userId != ownerId) {
    throw ForbiddenException('User cannot access another user\'s data');
  }
}