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

ability to delete a photo added thanks to Community #354

Open
plegall opened this issue Dec 18, 2019 · 5 comments
Open

ability to delete a photo added thanks to Community #354

plegall opened this issue Dec 18, 2019 · 5 comments
Labels
API: Community Requires an upgrade of the Community extension API required Requires a new extension

Comments

@plegall
Copy link
Member

plegall commented Dec 18, 2019

Related to #205

It would be logic to give users the ability to delete the photos they uploaded.

@EddyLB
Copy link
Collaborator

EddyLB commented Dec 18, 2019

Yes, but how can the app determine if a Community user can delete a photo?

Sent with GitHawk

@EddyLB EddyLB added the API: Community Requires an upgrade of the Community extension label Dec 18, 2019
@plegall
Copy link
Member Author

plegall commented Dec 20, 2019

You need to know if the current user matches the added_by field of the photo. Method pwg.images.getInfo will tell you that. Unfortunately pwg.session.getStatus does not tell you your user_id :-/ Then I also have to make sure pwg.images.delete is OK to let you delete a photo you uploaded, even if you're not an admin.

So, for now external apps can't fullfill the request. I have to work on Piwigo API first.

@EddyLB EddyLB added the API required Requires a new extension label Dec 23, 2019
@plegall
Copy link
Member Author

plegall commented Jan 31, 2020

The upcoming version of plugin Community let the user who added the photo delete it with pwg.images.delete. What's missing now is the information "is this photo added by the current user?".

I wrote earlier about making it match the added_by returned by pwg.images.getInfo but we need to know the user_id of the current user. I can implement that 2 ways:

  1. return the user_id in pwg.session.getStatus
  2. in the pwg.images.getInfo add a return field can_be_deleted and can_be_edited (which may depend on a setting in Community)

@EddyLB EddyLB pinned this issue Jan 31, 2020
@EddyLB EddyLB unpinned this issue Mar 21, 2020
@EddyLB EddyLB pinned this issue Mar 22, 2020
@EddyLB
Copy link
Collaborator

EddyLB commented Mar 22, 2020

I would prefer to use the pwg.session.getStatus method which is always called at login. The app will store the user_id which will be exploited for determining whether the user can edit/delete the photo. This user_id will also be useful when the app will introduce the management of users.

@EddyLB
Copy link
Collaborator

EddyLB commented Apr 4, 2020

It would then be great to extend pwg.images.getInfo as proposed in #228 so that the app can quickly get the properties of a list of photos belonging to a user.

@EddyLB EddyLB unpinned this issue Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API: Community Requires an upgrade of the Community extension API required Requires a new extension
Projects
None yet
Development

No branches or pull requests

2 participants