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

UrlControl issue: cannot upload for any role (Only works for admin/Superuser) #5423

Closed
erw13n opened this issue Dec 5, 2022 · 4 comments · Fixed by #5461
Closed

UrlControl issue: cannot upload for any role (Only works for admin/Superuser) #5423

erw13n opened this issue Dec 5, 2022 · 4 comments · Fixed by #5461

Comments

@erw13n
Copy link
Contributor

erw13n commented Dec 5, 2022

Description of bug

Upgraded to DNN 9.11
Form & List module still using UrlControl on one of their field, and it seems there's an issue on field with type "URL".
It doesn't allow users who is not "Admin" or "Superuser" to Upload file.

This is not an issue with Form & List module, because the issue within UrlControl
It happen even if the User Role have "Browse, View & Write" permission to folder.
Whenever press "Upload New File" it throw error "You don't have permission to upload files to this site."
This is not happen for "Admin" or "Superuser"

After browsing through the source code, this line seems check if user has "ADD" permission on the folder


Don't know if this is the cause of the issue.
But somehow it always throw "You don't have permission to upload files to this site." on every folder, even if it was "My Folder"

I check table "Permission" and I don't see any PermissionKey "ADD" for SYSTEM_FOLDER, it only have "READ, WRITE & BROWSE"
image

So whenever it call SP GetFoldersByPermissions it always return NULL, because there's no "ADD" permission.

Steps to reproduce

  1. Using "Form & List" module, create a new form
  2. At least one field type set to "URL"
  3. Set module permission "Create Record/ Submit Form" for certain role
  4. Set the same role to have "Browse, View & Write" permission to folder.
  5. "Add new Record", and change Link Type to "File", change folder and press "Upload new file"
  6. It throw "You don't have permission to upload files to this site." immediately

image

@MaiklT
Copy link
Contributor

MaiklT commented Dec 7, 2022

This seems to be an issue of the UrlControl - I have the same behaviour in the Links and Documents module.

@erw13n
Copy link
Contributor Author

erw13n commented Dec 7, 2022

I just notice that the old Digital Assets Management 9.8.1 had Add Permission in it:

image

@skamphuis
Copy link
Contributor

skamphuis commented Dec 29, 2022

Found this too. Submitting a PR for it.

The issue is that the URLControl tries for "ADD" permission on the selected folder, but that doesn't exist (anymore?). It should be "WRITE" instead.

skamphuis added a commit to skamphuis/Dnn.Platform that referenced this issue Dec 29, 2022
@skamphuis
Copy link
Contributor

skamphuis commented Dec 29, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants