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

Add permission to view duplicate images #428

Open
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()

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.

2 participants