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

Resolved #1651 where dropdowns in File field were showing the directories that member was not allowed to access #2344

Merged

Conversation

intoeetive
Copy link
Contributor

@intoeetive intoeetive commented Sep 1, 2022

Resolved #1651 where dropdowns in File field were showing the directories that member was not allowed to access

Testing instructions:
1.

  • have a non-superadmin role ("editors") that can access entries and files
  • have a file fields that can use all upload directories
  • create several upload destinations, allow your role to access few of those, but not all
  • login as editor
  • the dropdowns in file field should only show the directories editor has access to
  • uploading and browsing works
  • edit the role so thy can access only one directory
  • login as editor
  • the file field should not have dropdowns; the only allowed directory is preselected
  • uploading and browsing works
  1. Test # 2 with the subfolder - there should be dropdown with the only allowed directory and it's subfolderd

…ries that member was not allowed to access
@intoeetive intoeetive added the Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on. label Sep 1, 2022
@intoeetive intoeetive added this to the 7.2.0 milestone Sep 1, 2022
@intoeetive intoeetive modified the milestones: 7.2.0, 7.1.5 Sep 8, 2022
@robinsowell
Copy link
Contributor

I'm having some issues here with subdirectories. I THINK but won't swear they are related, because as superadmin, everything worked fine.

As non-superadmin with access to 2 file upload directories, I get errors when a directory has a subfolder.
Screen Shot 2022-09-08 at 3 07 26 PM

So basically, click 'choose existing' it properly gives me the 2 directories (but not the subdirectory), I choose the directory with a sub in it and I got the above error. If it's hard to see in image:

Warning
Undefined array key "href"
ee/ExpressionEngine/View/_shared/thumb.php, line 61

And as a user who only has access to a single directory that has a subfolder in it:

File field

  • click 'choose existing' and I get a blank modal opening.
  • click 'upload new' opens ok, I pick an image, it appears to upload it fine, but when it shows it, I get a 'you are not authorized':

Screen Shot 2022-09-08 at 3 14 19 PM

- click 'choose directory' I get my 1 directory and the sub, pick the sub, upload image, appears to work but then I get that 'you are not authorized' after upload.

@intoeetive
Copy link
Contributor Author

@robinsowell should be fixed now - can you check again?

As of the permission error, this must be the edge case whether the member can access directory A only, but the field is set to directory B only. The UI is currently does not respect that - if it needs to, we'd need a separate task, but this seems like real edge case. But the backend is fully respecting the restrictions, not allowing you to upload or select a file.

Copy link
Contributor

@robinsowell robinsowell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving, dropdowns show correctly, but I do still have that weird error where they can upload to a directory they should be able to upload to- but get a permission error and can't view the file.

@intoeetive intoeetive merged commit 1d4c552 into 7.dev Sep 9, 2022
@intoeetive intoeetive deleted the bug/7.x/file-field-show-allowed-directories-in-dropdown branch September 9, 2022 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users can see upload destinations they don't have access to and get an inaccurate error when uploading
2 participants