Skip to content

Commit b1b06c9

Browse files
committed
fixup! feat: Allow user backends to manage property permissions
Signed-off-by: Côme Chilliet <[email protected]>
1 parent 4737c4b commit b1b06c9

File tree

3 files changed

+7
-20
lines changed

3 files changed

+7
-20
lines changed

lib/private/User/User.php

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -414,30 +414,15 @@ public function getBackend(): ?UserInterface {
414414
return $this->backend;
415415
}
416416

417-
/**
418-
* Check if the backend allows the user to change their avatar on Personal page
419-
*
420-
* @return bool
421-
*/
422-
public function canChangeAvatar() {
417+
public function canChangeAvatar(): bool {
423418
return $this->canEditProperty(IAccountManager::PROPERTY_AVATAR);
424419
}
425420

426-
/**
427-
* check if the backend supports changing passwords
428-
*
429-
* @return bool
430-
*/
431-
public function canChangePassword() {
421+
public function canChangePassword(): bool {
432422
return $this->backend->implementsActions(Backend::SET_PASSWORD);
433423
}
434424

435-
/**
436-
* check if the backend supports changing display names
437-
*
438-
* @return bool
439-
*/
440-
public function canChangeDisplayName() {
425+
public function canChangeDisplayName(): bool {
441426
return $this->canEditProperty(IAccountManager::PROPERTY_DISPLAYNAME);
442427
}
443428

lib/public/IUser.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace OCP;
99

1010
use InvalidArgumentException;
11+
use OCP\Accounts\IAccountManager;
1112
use OCP\AppFramework\Attribute\Consumable;
1213

1314
/**

lib/public/User/Backend/IPropertyPermissionBackend.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
namespace OCP\User\Backend;
1111

12-
use OCP\Account\IAccountManager;
12+
use OCP\Accounts\IAccountManager;
13+
use OCP\AppFramework\Attribute\Consumable;
1314
use OCP\AppFramework\Attribute\Implementable;
1415

1516
/**
@@ -22,7 +23,7 @@ interface IPropertyPermissionBackend {
2223
* @since 34.0.0
2324
*
2425
* @param IAccountManager::PROPERTY_*|IAccountManager::COLLECTION_* $property
25-
* @return Whether the user is allowed to edit its own property
26+
* @return bool Whether the user is allowed to edit its own property
2627
*/
2728
public function canEditProperty(string $uid, string $property): bool;
2829
}

0 commit comments

Comments
 (0)