Skip to content

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

@slint

Description

@slint

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions