Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Allow users to upload media to shared albums #1256

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

the01
Copy link
Contributor

@the01 the01 commented May 12, 2024

Basic working implementation for #911

@derneuere could you please take a look?
As a first step, I took the simplest approach to get this feature working without changing the FE, so probably a few adjustments are needed.

I added a SHARED_ALBUM_ALL_ADD setting with an env variable of the same name, so that admins can decide if the basic functionality works for them or they want to wait until the edge cases are also covered.

Do we need to filter here again even though we already did it here?

Copy link

sonarcloud bot commented May 12, 2024

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@derneuere
Copy link
Member

The code looks good :) Looking forward to testing it!

You can only add images to a shared album, if you explicitly shared it with a user. I believe we could simplify things further by removing the setting for admin access in this scenario. I don't think, that we need the setting for admin in this case. However, I'm definitely open to discussion on this. If anyone there is a compelling reason to keep the admin setting, I'm all ears!

In general: Let's only keep deployment specific as an environment variable and the rest as a constance variable, which you can change within the program:

CONSTANCE_CONFIG = {

@the01
Copy link
Contributor Author

the01 commented May 13, 2024

I am not yet familiar enough with the code base to predict all possible side effects, but one scenario I could think of would be (accidental) deletion of pictures from the album by a sharee (I don't think its an actual word, but the ones the album was shared with). That is why I wanted to include an option to turn the feature off, at least globally.

I saw constance, but I assumed this is stored in the database and would require a migration. For the first test I wanted to limit the permanent/non-revertable changes, hence the env variable.
Long term it would be better to have this configurable per album as an additional field on AlbumUser or maybe even per Album&User specified on the relationship table.
But I think it would be better to start simple like this, gather some experience and then extend it to more fine-grained control later. (In part since this will require changes to the FE, which is not my strong suit 😆 )

@derneuere
Copy link
Member

Yes, that sounds like a viable approach :) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants