Add proper config for api acl #730

This commit is contained in:
Ramon Gutierrez 2023-02-08 02:24:25 +08:00
parent 693ee7cd9b
commit efec5c4b84
2 changed files with 121 additions and 86 deletions

View file

@ -591,26 +591,127 @@ catalyst_auth:
label: Delete
api:
user_entity: "Catalyst\\ApiBundle\\Entity\\User"
user_entity: "App\\Entity\\CustomerUser"
acl_data:
- id: api_test
label: Test
- id: warranty
label: Warranty Access
acls:
- id: api.test
label: Test
- id: api_user
label: API User Access
- id: warranty.list
label: List
- id: warranty.find.serial
label: Find by Serial
- id: warranty.find.platenumber
label: Find by Plate Number
- id: warranty.register.battery
label: Register Battery
- id: warranty.claim
label: Claim
- id: warranty.update
label: Update
- id: warranty.cancel
label: Cancel
- id: warranty.delete
label: Delete
- id: warranty.set.privacypolicy
label: Set Privacy Policy
- id: warranty.list.serial
label: List by Serial
- id: batterybrand
label: Battery Brand Access
acls:
- id: apiuser.change.password
label: Change User Password
- id: api_battery
label: API Battery Inventory Access
- id: batterybrand.list
label: List
- id: batterysize
label: Battery Size Access
acls:
- id: apibattery.get.info
label: Get Battery Info
- id: api_retailer
label: API Retailer Access
- id: batterysize.list
label: List
- id: battery
label: Battery Access
acls:
- id: apiretailer.register
label: Register Retailer
- id: battery.list
label: List
- id: vmanufacturer
label: Vehicle Manufacturer Access
acls:
- id: vmanufacturer.list
label: List
- id: vehicle
label: Vehicle Access
acls:
- id: vehicle.list
label: List
- id: privacypolicy
label: Privacy Policy
acls:
- id: privacypolicy.find
label: Find Privacy Policy
- id: customer
label: Customer
acls:
- id: customer.register
label: Register Customer
- id: customer.verify
label: Verify Customer
- id: municipality
label: Municipality
acls:
- id: municipality.list
label: List
- id: dealer
label: Dealer
acls:
- id: dealer.list
label: List
- id: warrantyserial
label: Warranty Serial
acls:
- id: warrantyserial.upload
label: Upload
- id: tapi_vmanufacturer
label: Third Party Vehicle Manufacturer Access
acls:
- id: tapi_vmanufacturer.list
label: List Third Party Vehicle Manufacturers
- id: tapi_vehicle
label: Third Party Vehicle Make Access
acls:
- id: tapi_vehicle.list
label: List Third Party Vehicles
- id: tapi_promo
label: Third Party Promo Access
acls:
- id: tapi_promo.list
label: List Third Party Promos
- id: tapi_battery
label: Third Party Battery Access
acls:
- id: tapi_battery_compatible.list
label: List Third Party Compatible Batteries
- id: tapi_jo
label: Third Party Job Order Access
acls:
- id: tapi_jo.request
label: Third Party Request Job Order
- id: tapi_jo.get.estimate
label: Third Party Get Estimate
- id: tapi_jo.get.ongoing
label: Third Party Get Ongoing Job Order
- id: tapi_jo.cancel
label: Third Party Cancel Job Order
- id: tapi_jo.get.invoice
label: Third Party Get Job Order Invoice
- id: tapi_jo.location.support
label: Third Party Check Location Support
- id: tapi_jo.nearest_hub.get
label: Third Party Get Nearest Hub and Slots
- id: tapi_jo.schedule_option.status
label: Third Party Schedule Option Status
- id: tapi_jo.get.info
label: Third Party Get Job Order Info
- id: tapi_service
label: Third Party Service Access
acls:
- id: tapi_service.list
label: List Third Party Services

View file

@ -8,7 +8,7 @@ use Catalyst\ApiBundle\Entity\User as BaseUser;
/**
* @ORM\Entity
* @ORM\Table(name="api_user")
* @ORM\Table(name="customer_user")
*/
class CustomerUser extends BaseUser
{
@ -23,42 +23,9 @@ class CustomerUser extends BaseUser
protected $name;
/**
* @ORM\Column(type="string", length=100)
* @ORM\Column(type="boolean")
*/
protected $contact_number;
/**
* @ORM\Column(type="string", length=50)
*/
protected $email;
// notification token for android / ios notification sending
/**
* @ORM\Column(type="text", nullable=true)
*/
protected $notif_token;
public function setUsername($username)
{
$this->username = $username;
return $this;
}
public function getUsername()
{
return $this->username;
}
public function setPassword($password)
{
$this->password = $password;
return $this;
}
public function getPassword()
{
return $this->password;
}
protected $enabled;
public function setName($name)
{
@ -70,37 +37,4 @@ class CustomerUser extends BaseUser
{
return $this->name;
}
public function setContactNumber($num)
{
$this->contact_number = $num;
return $this;
}
public function getContactNumber()
{
return $this->contact_number;
}
public function setEmail($email)
{
$this->email = $email;
return $this;
}
public function getEmail()
{
return $this->email;
}
public function setNotificationToken($token)
{
$this->notif_token = $token;
return $this;
}
public function getNotificationToken()
{
return $this->notif_token;
}
}