server
server copied to clipboard
feat(users): Store and load a user's manager
- Resolves: https://github.com/nextcloud/server/issues/37963
Summary
Allow (sub) admins to set a user's manager.
TODO
- [x] Backend for the new user property
- [x] Frontend for the new user property
- [x] System address book mapping
- [x] Trigger update event for assigned admin so the system address book card gets regenerated
Checklist
- Code is properly formatted
- Sign-off message is added to all commits
- [ ] Tests (unit, integration, api and/or acceptance) are included
- [ ] Screenshots before/after for front-end changes
- [ ] Documentation (manuals or wiki) has been updated or is not required
- [ ] Backports requested where applicable (ex: critical bugfixes)
Nice to have: remove the uid when the manager is deleted. A listener for user deleted is already there: https://github.com/nextcloud/server/blob/master/apps/provisioning_api/lib/Listener/UserDeletedListener.php
Frontend for the new user property
Is that done @hamza221 or do we miss anything?
Frontend for the new user property
Is that done @hamza221 or do we miss anything?
Done
Mapping is done too. ~~The only missing piece is change detection and regeneration of the card when the admin property is updated.~~ done
/compile /
- [x] BUG can't set myself as manager of another user
Turns out uid!=displayname for my test user. searching by display name works :+1:
@skjnldsv this feature is scheduled for 27
/compile amend /
@skjnldsv this feature is scheduled for 27
as long as it's merged before Tuesday morning :wink:
https://github.com/nextcloud/server/issues/38145 will probably address that
/compile amend /
Error: apps/files_external/lib/Lib/Storage/AmazonS3.php:339:18: InvalidReturnType: The declared return type 'false|resource' for OCA\Files_External\Lib\Storage\AmazonS3::opendir is incorrect, got 'bool|resource' (see https://psalm.dev/011)
and similar but can't figure out why this shows here. The PR doesn't touch any file handling.
X-MANAGERSNAME;UID=admin;X-NC-SCOPE=v2-local:Christoph Wurst
works flawless combined with https://github.com/nextcloud/server/pull/38048
Files sharing acceptance test fails. Most likely unrelated?
--- Failed scenarios:
/drone/src/build/integration/features/contacts-menu.feature:74
/drone/src/build/integration/features/contacts-menu.feature:109
/drone/src/build/integration/features/contacts-menu.feature:164
/drone/src/build/integration/features/contacts-menu.feature:178
Seems related though
@skjnldsv are you sure? The contacts menu integration tests fail on so many PRs recently
@skjnldsv are you sure? The contacts menu integration tests fail on so many PRs recently
seems like you're right indeed :)
Took a random other PR and it's the same tests that fail: https://github.com/nextcloud/server/pull/38188 https://drone.nextcloud.com/nextcloud/server/33791/36/3
:relieved:
The tests are broken in general. Everything is fine.
acceptance-app-files-sharing is suspicious
Rebased because I can't restart Drone
acceptance-app-files-sharing fails reliably
When locally running the acceptance tests the Nextcloud logs show (docker exec nextcloud-local-test-acceptance tail -f /var/www/html/data/nextcloud.log
) the error ...POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"Class OCA\\Notifications\\FakeUser contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (OCP\\IUser::getManagerUids, OCP\\IUser::setManagerUids) at /nextcloud/apps/notifications/lib/FakeUser.php#30"...
.
The Notifications app is installed when setting up the acceptance tests environment, but if present the existing app will be used without downloading it again. The failing acceptance tests pass after adding the following to an existing apps/notifications/lib/FakeUser.php:
public function getManagerUids(): array {
throw new \RuntimeException('Not implemented');
}
public function setManagerUids(array $uids): void {
throw new \RuntimeException('Not implemented');
}
You are the best, honestly.
Alright. I'm giving this PR a final rebase. https://github.com/nextcloud/notifications/pull/1544 is pending. If it gets merged soon the tests will pass here.
seems some rebuilds are needed. fyi, there'll be a nc/vue bump following as well.
OK can you tell me if I should rebase already or wait for the vue bump merge @blizzz? Cheers
OK can you tell me if I should rebase already or wait for the vue bump merge @blizzz? Cheers
Wait until https://github.com/nextcloud/server/pull/38214 is merged
showtime
showtime
there are not just bundle conflicts. we have to adjust the front-end after https://github.com/nextcloud/server/pull/37870