Page MenuHomekolab.org

Shared folder aliases
ClosedPublic

Authored by machniak on Feb 1 2022, 8:45 AM.

Details

Reviewers
mollekopf
Group Reviewers
Restricted Project
Commits
rKc76b08d854d8: Shared folder aliases
Test Plan

./phpunit

Diff Detail

Repository
rK kolab
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

machniak requested review of this revision.Feb 1 2022, 8:45 AM
machniak created this revision.
machniak updated this revision to Diff 9511.Feb 1 2022, 10:11 AM
  • Various fixes, improvements
machniak updated this revision to Diff 9517.Feb 1 2022, 12:12 PM
  • Fixes
  • Merge branch 'master' into dev/shared-folder-aliases
  • More tests
machniak updated this revision to Diff 9523.Feb 1 2022, 2:49 PM
  • Merge branch 'master' into dev/shared-folder-aliases
Harbormaster completed remote builds in B38215: Diff 9523.
mollekopf added inline comments.
src/app/Console/Commands/SharedFolder/AddAliasCommand.php
42

Could another folder already occupy the same alias?

51

Is there a usecase for this? Why would the validation fail and we still want to force create it?

src/app/Http/Controllers/API/V4/Admin/UsersController.php
68

This allows to search for a user using an alias to a shared folder the user owns?
This seems odd to me, but the same goes for resources and shared folders I suppose.
Nothing to fix I guess, just a comment to perhaps reconsider if this is really useful.

src/app/Resource.php
34

Why must this be the first after UuidIntKeyTrait?

machniak added inline comments.Feb 15 2022, 5:54 PM
src/app/Console/Commands/SharedFolder/AddAliasCommand.php
42

This check here is to prevent the same alias added twice to the folder. Answering the question... we apply the same rules as to users, see validateAlias() below. So, the same alias can be assigned to many folders in a custom domain.

51

I'm not sure. It was copy-pasted from the existing user:add-alias command.

src/app/Http/Controllers/API/V4/Admin/UsersController.php
68

I guess sometimes you might just have an email address of someone/something. So, it makes sense, but probably a rare case.

src/app/Resource.php
34

Both traits register "creating" event handler, and EmailPropertyTrait's handler needs the $id property to be set (which is set by the other trait). See bootEmailPropertyTrait().

mollekopf accepted this revision.Feb 22 2022, 10:13 AM
This revision is now accepted and ready to land.Feb 22 2022, 10:13 AM
This revision was automatically updated to reflect the committed changes.