WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

Author selection for Pages should not include users with roles lower than Editor

Open twstokes opened this issue 2 years ago • 2 comments

Expected behavior

List doesn't contain users who have a role lower than Editor.

Actual behavior

List contains users who have a role lower than Editor, although they cannot technically publish Pages.

When tapping Publish:

  • Self-hosted sites without a WordPress.com connection do not throw an error.
  • WordPress.com sites throw an error from the backend that is presented by the user interface.
Error Domain=WordPressKit.WordPressComRestApiError Code=2 "Assigned author cannot publish post." UserInfo={NSLocalizedDescription=Assigned author cannot publish post., WordPressComRestApiErrorCodeKey=unauthorized, WordPressComRestApiErrorMessageKey=Assigned author cannot publish post.}

Steps to reproduce the behavior

Prerequisites: Two users exist on a blog - one Administrator role, and one lower than Editor (e.g. Author or Contributor).

  1. Log into the app as the Administrator user
  2. Tap the FAB and select Site page to create a page
  3. Choose any layout
    • ℹ️ If the Blank Page layout was chosen, populate a title
  4. In the Page settings tap Author
  5. Observe: The list of users

Notes

WordPress.com's web interface (Calypso) allows one of these users to be set and for the Page to be published without error.

Tested on iPhone 14, iOS 16.2, WPiOS 21.5

twstokes avatar Jan 11 '23 05:01 twstokes

WPAndroid issue: https://github.com/wordpress-mobile/WordPress-Android/issues/17739

twstokes avatar Jan 11 '23 06:01 twstokes

This now works better as the error message contains the reason why it fails, which I think is an acceptable solution:

– less logic to be hardcoded in the app – no guessing why a user is missing from the list

kean avatar May 01 '24 18:05 kean