Skip to content

Add permission to view duplicate images #428

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

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mdashlw
Copy link
Contributor

@mdashlw mdashlw commented Feb 22, 2025

Before you begin

  • I understand my contributions may be rejected for any reason
  • I understand my contributions are for the benefit of Derpibooru and/or the Philomena software
  • I understand my contributions are licensed under the GNU AGPLv3
  • I understand all of the above

Continuation of #412
Depends on #427

Adds a new permission "View duplicate images" that allows regular users to :show and :index duplicate images. All other interaction is blocked, except for :vote which depends on :show.

Image API will return full information about the images for authorized users. Search API will only return duplicates if ?del=1 is specified (handled by ImageLoader).
A side-effect of API now doing can?(user, :show, image) is that mods/admins can now use their api key and view (non-duplicate) deleted images.

This depends on a new Role for which there's no migration mechanism so it needs to be created manually:

alias Philomena.Roles.Role
%Role{name: "duplicate_access", resource_type: "Image"} |> Role.changeset(%{}) |> Repo.insert()

@Meow Meow added this to the 1.2 milestone May 9, 2025
@Meow
Copy link
Member

Meow commented May 12, 2025

Resolve conflicts here please

@Meow Meow added the waiting on author Further progress is blocked by an action from the author of the PR/issue label May 12, 2025
@mdashlw mdashlw marked this pull request as draft May 12, 2025 09:45
@Meow Meow removed this from the 1.2 milestone May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting on author Further progress is blocked by an action from the author of the PR/issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants