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

"New upload" button shouldn't be disabled for anonymous/guest users #1252

Open
slint opened this issue Nov 25, 2024 · 0 comments
Open

"New upload" button shouldn't be disabled for anonymous/guest users #1252

slint opened this issue Nov 25, 2024 · 0 comments

Comments

@slint
Copy link
Member

slint commented Nov 25, 2024

The "New upload" button in the community header uses permissions to determine if the button should be disabled, and if it is, displays a tooltip with the text "Submission to this community is only allowed to community members.". This is supposed to be controlled by the submission policy setting introduced in #1189.

There is an issue though when anonymous users access the page, since the permission check resolves to False since to determine if a user can submit, they need to be logged-in to be able to check if they are a member of the community:

image

I think the solution would be to change the logic so that:

  • If the community has an open submission policy, always display the button as enabled
  • If the community has a closed submission policy...
    • If the user is logged-in, we can perform the permission check as usual and display the button as disabled/enabled with the appropriate explanation tooltip
    • If the user is anonymous, we display the button as enabled. If the user clicks on it, they will anyways be redirected to the login page, and afterwards redirected to the upload form which IIRC will show a permission error message.
      • An alternative would be to display a more informative "you need to be logged-in to check if you can upload to this community" message, with a link to the login page with a redirect back to the community page
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

No branches or pull requests

1 participant