"""
Permissions for administrators and customers. Used to control access to
GraphQL resolvers via the {
@link Allow} decorator.
## Understanding Permission.Owner
`Permission.Owner` is a special permission which is used in some Vendure resolvers to indicate that that resolver should only
be accessible to the "owner" of that resource.
For example, the Shop API activeCustomer query resolver should only return the Customer object for the "owner" of that Customer, i.e.
based on the activeUserId of the current session. As a result, the resolver code looks like this:
```TypeScript
async activeCustomer(\
@Ctx() ctx: RequestContext): Promise<Customer | undefined> {
const userId = ctx.activeUserId;
if (userId) {
return this.customerService.findOneByUserId(ctx, userId);
}
}
```
Here we can see that the "ownership" must be enforced by custom logic inside the resolver. Since "ownership" cannot be defined generally
nor statically encoded at build-time, any resolvers using Permission.Owner **must** include logic to enforce that only the owner
of the resource has access. If not, then it is the equivalent of using `Permission.Public`.
"""
enum Permission {
"""Authenticated means simply that the user is logged in"""
Authenticated
"""SuperAdmin has unrestricted access to all operations"""
SuperAdmin
"""Owner means the user owns this entity, e.g. a Customer's own Order"""
Owner
"""Public means any unauthenticated user may perform the operation"""
Public
"""Grants permission to update GlobalSettings"""
UpdateGlobalSettings
"""Grants permission to create Products, Facets, Assets, Collections"""
CreateCatalog
"""Grants permission to read Products, Facets, Assets, Collections"""
ReadCatalog
"""Grants permission to update Products, Facets, Assets, Collections"""
UpdateCatalog
"""Grants permission to delete Products, Facets, Assets, Collections"""
DeleteCatalog
"""Grants permission to create PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings"""
CreateSettings
"""Grants permission to read PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings"""
ReadSettings
"""Grants permission to update PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings"""
UpdateSettings
"""Grants permission to delete PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings"""
DeleteSettings
"""Grants permission to create Administrator"""
CreateAdministrator
"""Grants permission to read Administrator"""
ReadAdministrator
"""Grants permission to update Administrator"""
UpdateAdministrator
"""Grants permission to delete Administrator"""
DeleteAdministrator
"""Grants permission to create Asset"""
CreateAsset
"""Grants permission to read Asset"""
ReadAsset
"""Grants permission to update Asset"""
UpdateAsset
"""Grants permission to delete Asset"""
DeleteAsset
"""Grants permission to create Channel"""
CreateChannel
"""Grants permission to read Channel"""
ReadChannel
"""Grants permission to update Channel"""
UpdateChannel
"""Grants permission to delete Channel"""
DeleteChannel
"""Grants permission to create Collection"""
CreateCollection
"""Grants permission to read Collection"""
ReadCollection
"""Grants permission to update Collection"""
UpdateCollection
"""Grants permission to delete Collection"""
DeleteCollection
"""Grants permission to create Country"""
CreateCountry
"""Grants permission to read Country"""
ReadCountry
"""Grants permission to update Country"""
UpdateCountry
"""Grants permission to delete Country"""
DeleteCountry
"""Grants permission to create Customer"""
CreateCustomer
"""Grants permission to read Customer"""
ReadCustomer
"""Grants permission to update Customer"""
UpdateCustomer
"""Grants permission to delete Customer"""
DeleteCustomer
"""Grants permission to create CustomerGroup"""
CreateCustomerGroup
"""Grants permission to read CustomerGroup"""
ReadCustomerGroup
"""Grants permission to update CustomerGroup"""
UpdateCustomerGroup
"""Grants permission to delete CustomerGroup"""
DeleteCustomerGroup
"""Grants permission to create Facet"""
CreateFacet
"""Grants permission to read Facet"""
ReadFacet
"""Grants permission to update Facet"""
UpdateFacet
"""Grants permission to delete Facet"""
DeleteFacet
"""Grants permission to create Order"""
CreateOrder
"""Grants permission to read Order"""
ReadOrder
"""Grants permission to update Order"""
UpdateOrder
"""Grants permission to delete Order"""
DeleteOrder
"""Grants permission to create PaymentMethod"""
CreatePaymentMethod
"""Grants permission to read PaymentMethod"""
ReadPaymentMethod
"""Grants permission to update PaymentMethod"""
UpdatePaymentMethod
"""Grants permission to delete PaymentMethod"""
DeletePaymentMethod
"""Grants permission to create Product"""
CreateProduct
"""Grants permission to read Product"""
ReadProduct
"""Grants permission to update Product"""
UpdateProduct
"""Grants permission to delete Product"""
DeleteProduct
"""Grants permission to create Promotion"""
CreatePromotion
"""Grants permission to read Promotion"""
ReadPromotion
"""Grants permission to update Promotion"""
UpdatePromotion
"""Grants permission to delete Promotion"""
DeletePromotion
"""Grants permission to create ShippingMethod"""
CreateShippingMethod
"""Grants permission to read ShippingMethod"""
ReadShippingMethod
"""Grants permission to update ShippingMethod"""
UpdateShippingMethod
"""Grants permission to delete ShippingMethod"""
DeleteShippingMethod
"""Grants permission to create Tag"""
CreateTag
"""Grants permission to read Tag"""
ReadTag
"""Grants permission to update Tag"""
UpdateTag
"""Grants permission to delete Tag"""
DeleteTag
"""Grants permission to create TaxCategory"""
CreateTaxCategory
"""Grants permission to read TaxCategory"""
ReadTaxCategory
"""Grants permission to update TaxCategory"""
UpdateTaxCategory
"""Grants permission to delete TaxCategory"""
DeleteTaxCategory
"""Grants permission to create TaxRate"""
CreateTaxRate
"""Grants permission to read TaxRate"""
ReadTaxRate
"""Grants permission to update TaxRate"""
UpdateTaxRate
"""Grants permission to delete TaxRate"""
DeleteTaxRate
"""Grants permission to create Seller"""
CreateSeller
"""Grants permission to read Seller"""
ReadSeller
"""Grants permission to update Seller"""
UpdateSeller
"""Grants permission to delete Seller"""
DeleteSeller
"""Grants permission to create StockLocation"""
CreateStockLocation
"""Grants permission to read StockLocation"""
ReadStockLocation
"""Grants permission to update StockLocation"""
UpdateStockLocation
"""Grants permission to delete StockLocation"""
DeleteStockLocation
"""Grants permission to create System"""
CreateSystem
"""Grants permission to read System"""
ReadSystem
"""Grants permission to update System"""
UpdateSystem
"""Grants permission to delete System"""
DeleteSystem
"""Grants permission to create Zone"""
CreateZone
"""Grants permission to read Zone"""
ReadZone
"""Grants permission to update Zone"""
UpdateZone
"""Grants permission to delete Zone"""
DeleteZone
}