mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-18 07:52:21 +01:00
Don't hardcode backend name in AddressBookController
This commit is contained in:
parent
87883af406
commit
ae095acb2b
@ -107,11 +107,11 @@ class AddressBookController extends BaseController {
|
||||
*/
|
||||
public function addAddressBook() {
|
||||
$app = new App($this->api->getUserId());
|
||||
$params = $this->request->urlParams;
|
||||
|
||||
$response = new JSONResponse();
|
||||
|
||||
$backend = $app->getBackend('local');
|
||||
// TODO: Check actual permissions
|
||||
$backend = $app->getBackend($params['backend']);
|
||||
if(!$backend->hasAddressBookMethodFor(\OCP\PERMISSION_CREATE)) {
|
||||
throw new \Exception('Not implemented');
|
||||
}
|
||||
@ -157,7 +157,7 @@ class AddressBookController extends BaseController {
|
||||
|
||||
$response = new JSONResponse();
|
||||
|
||||
$backend = $app->getBackend('local');
|
||||
$backend = $app->getBackend($params['backend']);
|
||||
// TODO: Check actual permissions
|
||||
if(!$backend->hasAddressBookMethodFor(\OCP\PERMISSION_DELETE)) {
|
||||
throw new \Exception('Not implemented');
|
||||
|
Loading…
x
Reference in New Issue
Block a user