dnnsoftware / Dnn.Platform

DNN (formerly DotNetNuke) is the leading open source web content management platform (CMS) in the Microsoft ecosystem.
https://dnncommunity.org/
MIT License
1.03k stars 751 forks source link

[Bug]: Resource Manager Error: cannot Add or Remove Permissions on Folders #5857

Open jeremy-farrance opened 1 year ago

jeremy-farrance commented 1 year ago

Is there an existing issue for this?

What happened?

Multiple related issues with Permissions not saving, including one that throws a console error, "TypeError: Cannot read properties of null (reading 'rolePermissions') in dnn-rm-edit-folder.tsx, line 133.

Details below in Steps to reproduce...

ERRORS on steps 15/16, 21/22

Steps to reproduce?

Using a clean new install of DNN v9.13.00:

  1. Go to Persona Bar, Manage / Roles
  2. Add a new Role named, "Content Manager"
  3. Go to Persona Bar, Manage / Site Assets (/Admin/File-Management)
  4. Add a new Folder in the root; Type=Standard and Name=Standard
  5. Add a new Folder in the root; Type=Secure and Name=Secure
  6. Find a PDF and JPG (local) file for testing
  7. Upload the PDF and JPG files to the Standard folder
  8. Upload the same PDF and JPG files to the Secure folder
  9. In the left pane Folder tree view, click on and select the Standard folder
  10. Right-click the Standard folder and select Edit
  11. Switch to the Permissions tab
  12. Open DevTools so you can see the Console
  13. Add the Content Manager role; allow View and Browse, leave Write clear, then Save
  14. Right-click (again) the Standard folder and select Edit
  15. Try to remove the Content Manager role by clicking the (x) to the right
  16. The console should show the following error: image
  17. Click Save anyhow in the still open Edit dialog
  18. Refresh the page
  19. Edit the Standard folder again, go to Permissions; the Content Manager role is still there
  20. For the All Users role, now uncheck (clear) View and Browse (Write should be unchecked too)
  21. Click Save (no console errors)
  22. Return to Edit/Permissions for the Standard folder; note that All Users View and Browse are checked still

Repeat the above steps (Standard folder) on the Secure folder and observe the results. Try doing page refreshes and not after each save. Strangely, the results will be different. Sometimes it works. Sometimes it works PARTIALLY (e.g. for All Users, uncheck Write and Browse, Save, and when you come back, Write is checked and Browse is not).

Emphasizing: The Standard folder never saves changes to Roles; Write/Browse. And weirdly, the Secured folder works sometimes and partially.

Example of Secure folder with Write and Browse checked for All Users

Before: image

Intended settings (changes): image

UNEXPECTED Results After Save: image

Note: above is an example of the random results, again, sometimes it works, sometimes partial, and as you see above, sometimes very unexpected.

Current Behavior

No response

Expected Behavior

No response

Relevant log output

No response

Anything else?

Only testing on Chrome and Firefox, same results.

Affected Versions

v9.13.0 and v9.13.01 (updated after new tests on just released DNN; 20231207 JRF)

What browsers are you seeing the problem on?

Firefox, Chrome

Code of Conduct

jeremy-farrance commented 11 months ago

Just tested this after upgrading to yesterday's DNN release, v9.13.01 and the problems are not resolved. Screenshot below showing the after on Step 15 above. 1) DNN v9.13.01, 2) (x) has just been clicked, 3) JS console error appears immediately and is that same as reported above.

image

kevinwolter commented 11 months ago

We are experiencing the same issue and was hopeful that it was resolved with #5865 but this still appears to be an issue in 9.13.1 so maybe these are unrelated.

jeremy-farrance commented 10 months ago

This is still an easy to reproduce error in v9.13.02 on a quick/default install. I just used nvQuickSite, ran through the steps above on DNN v9.13.02, same result on step 16: image

6TELOIV commented 5 months ago

Can confirm, running into this bug as well.

jeremy-farrance commented 4 months ago

Since this was possibly or partially related to #6045 (#6046) which was fixed in v9.13.04 rc1, I wanted to test and see if there was any change in behavior or improvement.

This is still broken and appears to be worse, as it now fails in a similar way at an earlier step than before.

On Step 13 above, as soon as you click Add for the All Roles/Content Manager role, you see the following error in the DevTools console, thought the element becomes visible in the Edit Permissions modal:

image

Note that the results are the same for the Secure folder. And it makes no difference if you right-click on the Standard or Secure folder-list (left) or the items-listview (right). The steps provided above make this easy to reproduce in v9.13.04 (as of RC1).

I apologize that I do not have the skills set to provide a fix for this. But I am trying to contribute by providing easy to follow steps and details to reproduce the issue. Thanks - Jeremy

jeremy-farrance commented 4 days ago

I just re-tested this using the just released DNN v9.13.06 and the update above from Jul 18 is still mostly accurate. Multiple errors are thrown in the console (error reading 'permissions' at dnn-rm-edit-folder.tsx:137:112 (same as above) and when you click Save nothing happens, the new Role is not added. I am updating the title of this issue accordingly.

jeremy-farrance commented 4 days ago

I also tested and could not find any direct way that this was related to the new Resource Manager Issue #6214.

jeremy-farrance commented 4 days ago

This demonstration video should make the issue very clear. You cannot add a Role to a folder in DNN v9.13.06. This is a fresh install locally using nvQuickSite. https://github.com/user-attachments/assets/3f4cc746-8994-423b-a3f4-bfd5ac4ed378