Skip to content

Commit

Permalink
Updated Authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasBrazi06 committed Nov 16, 2021
1 parent 720e2f0 commit 9263b61
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ SPEC CHECKSUMS:
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
Fabric: ea977e3cd9c20425516d3dafd3bf8c941c51223f
FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b
FBReactNativeSpec: 52a80ca1a343877d4c72738fffcf539ac4a64dec
FBReactNativeSpec: e30d74099a6ef3e67364c1ecb8ab68197a5eb022
Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
FirebaseAnalytics: 5dd088bd2e67bb9d13dbf792d1164ceaf3052193
FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd
Expand Down
6 changes: 3 additions & 3 deletions src/provider/SecurityProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default class SecurityProvider {
}

public canListUsers(): boolean {
return this.canAccess(Entity.USERS, Action.LIST);
return this.canAccess(Entity.USER, Action.LIST);
}

public canListTags(): boolean {
Expand All @@ -123,10 +123,10 @@ export default class SecurityProvider {
}

public canListInvoices(): boolean {
return this.canAccess(Entity.INVOICES, Action.LIST);
return this.canAccess(Entity.INVOICE, Action.LIST);
}

public canListPaymentMethods(): boolean {
return this.canAccess(Entity.PAYMENT_METHODS, Action.LIST);
return this.canAccess(Entity.PAYMENT_METHOD, Action.LIST);
}
}
34 changes: 14 additions & 20 deletions src/types/Authorization.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
export enum Entity {
SITE = 'Site',
SITES = 'Sites',
SITE_AREA = 'SiteArea',
SITE_AREAS = 'SiteAreas',
COMPANY = 'Company',
COMPANIES = 'Companies',
CHARGING_STATION = 'ChargingStation',
CHARGING_STATIONS = 'ChargingStations',
TENANT = 'Tenant',
TENANTS = 'Tenants',
TRANSACTION = 'Transaction',
TRANSACTIONS = 'Transactions',
TRANSACTION_METER_VALUES = 'MeterValues',
TRANSACTION_STOP = 'Stop',
REPORT = 'Report',
USER = 'User',
USERS = 'Users',
TAGS = 'Tags',
VEHICLE_MANUFACTURER = 'VehicleManufacturer',
VEHICLE_MANUFACTURERS = 'VehicleManufacturers',
CARS = 'Cars',
LOGGINGS = 'Loggings',
USERS_SITES = 'UsersSites',
LOGGING = 'Logging',
PRICING = 'Pricing',
INVOICES = 'Invoices',
PAYMENT_METHODS = 'PaymentMethods',
PRICING_DEFINITION = 'PricingDefinition',
BILLING = 'Billing',
SETTING = 'Setting',
SETTINGS = 'Settings',
TOKENS = 'Tokens',
TOKEN = 'Token',
ASYNC_TASK = 'AsyncTask',
OCPI_ENDPOINT = 'OcpiEndpoint',
OCPI_ENDPOINTS = 'OcpiEndpoints',
OICP_ENDPOINT = 'OicpEndpoint',
CONNECTION = 'Connection',
CONNECTIONS = 'Connections'
ASSET = 'Asset',
CAR_CATALOG = 'CarCatalog',
CAR = 'Car',
INVOICE = 'Invoice',
TAX = 'Tax',
REGISTRATION_TOKEN = 'RegistrationToken',
CHARGING_PROFILE = 'ChargingProfile',
NOTIFICATION = 'Notification',
TAG = 'Tag',
PAYMENT_METHOD = 'PaymentMethod',
}

export enum Role {
Expand Down

0 comments on commit 9263b61

Please sign in to comment.