Lychee icon indicating copy to clipboard operation
Lychee copied to clipboard

Newly user created album should be opened on create in admin owned album

Open ildyria opened this issue 1 year ago • 1 comments

Discussed in https://github.com/LycheeOrg/Lychee/discussions/2296

Originally posted by haivala February 20, 2024

Lychee version

master

Which PHP version are you using?

PHP 8.2

Detailed description of the problem

When I create album as a user in admin owned album I'm redirected to front page. I think the newly created album should opened instead.

Steps to reproduce the issue

  1. create album as admin
  2. share album with user
  3. make album public by url
  4. login as user
  5. try to create album to this admin owned album
  6. User is redirected to front page
  7. As a user I cannot see this newly created album in the admin owned album.
  8. When I login as admin the album has been created but the owner is admin.

Is this expected? Should it be changed?

I have album structure Album (Event) - Album (photographer) - Pictures I achieve this now so that I let the users make the Event album where they state their name and as a admin I move the user owned album to the admin owned album, but I think it would be more usable the way I just tried and described as It would give the user all permissions to the albums they own and permissions would not be transferred to admin.

Diagnostics [REQUIRED]

System Information
------------------
Lychee Version (git):                    master (57e3503) -- Up to date (unknown).
DB Version:                              5.1.2

composer install:                        --no-dev
APP_ENV:                                 production
APP_DEBUG:                               false
APP_URL:                                 set
APP_DIR:                                 default
LOG_VIEWER_ENABLED:                      true
LIVEWIRE_ENABLED:                        true

System:                                  Linux
PHP Version:                             8.2.15
PHP User agent:                          Lychee/4 (https://lycheeorg.github.io/)
Timezone:                                Europe/Helsinki
Max uploaded file size:                  500M
Max post size:                           300M
Livewire chunk size:                     12.00 MB
Max execution time:                      0
MySQL Version:                           10.11.7-MariaDB-1:10.11.7+maria~ubu2204

exec() Available:                        yes
Imagick Available:                       1
Imagick Enabled:                         1
Imagick Version:                         1809
GD Version:                              bundled (2.1.0 compatible)
Number of foreign key:                   12 found.

Browser & System [REQUIRED]

FF, Docker

Please confirm (incomplete submissions will not be addressed)

  • [X] I have provided easy and step-by-step instructions to reproduce the bug.
  • [X] I understand my bug report will be removed if I haven't met the criteria above.

ildyria avatar Feb 21 '24 10:02 ildyria

For this reason the newly created album is owned by admin. And because it is not shared, the user who is usually redirected after creation inside the album is automatically booted to front.

The fix I can see is that when such occasion occur, an access_permission should also be added for the current user. Very easy fix actually.

ildyria avatar Feb 21 '24 10:02 ildyria