Skip to content

Prevent media uploads for users without permission #6160

@tonyr59h

Description

@tonyr59h

Expected behavior

If I attempt to add media to the library/post I should be notified that I lack permissions to do so and the media should not be added to the list/post.

An actionable message should be shown via toast/dialog detailing the lack of permissions and what they can do to gain them.

Something like:

You user role restricts media uploads. Please contact your site administrator to request access to this feature.

cc @mattmiklic

Actual behavior

I'm able to add media to the library but the upload fails with a permissions issue. The failed media is added to the post/library but will always fail to upload. The error message toasted is appropriate but media should never get to the point of attempting an upload we know will fail.

Steps to reproduce the behavior

  1. Sign in as a contributor to a site
  2. Add media to library or a post

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions