@vendure/admin-ui 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4589,6 +4589,31 @@ var LogicalOperator;
4589
4589
  * Permissions for administrators and customers. Used to control access to
4590
4590
  * GraphQL resolvers via the {@link Allow} decorator.
4591
4591
  *
4592
+ * ## Understanding Permission.Owner
4593
+ *
4594
+ * `Permission.Owner` is a special permission which is used in some of the Vendure resolvers to indicate that that resolver should only
4595
+ * be accessible to the "owner" of that resource.
4596
+ *
4597
+ * For example, the Shop API `activeCustomer` query resolver should only return the Customer object for the "owner" of that Customer, i.e.
4598
+ * based on the activeUserId of the current session. As a result, the resolver code looks like this:
4599
+ *
4600
+ * @example
4601
+ * ```TypeScript
4602
+ * \@Query()
4603
+ * \@Allow(Permission.Owner)
4604
+ * async activeCustomer(\@Ctx() ctx: RequestContext): Promise<Customer | undefined> {
4605
+ * const userId = ctx.activeUserId;
4606
+ * if (userId) {
4607
+ * return this.customerService.findOneByUserId(ctx, userId);
4608
+ * }
4609
+ * }
4610
+ * ```
4611
+ *
4612
+ * Here we can see that the "ownership" must be enforced by custom logic inside the resolver. Since "ownership" cannot be defined generally
4613
+ * nor statically encoded at build-time, any resolvers using `Permission.Owner` **must** include logic to enforce that only the owner
4614
+ * of the resource has access. If not, then it is the equivalent of using `Permission.Public`.
4615
+ *
4616
+ *
4592
4617
  * @docsCategory common
4593
4618
  */
4594
4619
  var Permission;
@@ -15552,7 +15577,7 @@ function patchObject(obj, patch) {
15552
15577
  }
15553
15578
 
15554
15579
  // Auto-generated by the set-version.js script.
15555
- const ADMIN_UI_VERSION = '1.5.0';
15580
+ const ADMIN_UI_VERSION = '1.5.1';
15556
15581
 
15557
15582
  /**
15558
15583
  * Responsible for registering dashboard widget components and querying for layouts.