Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug]: Moving Folders Occasionally Results in Duplicate Permissions

Open
#7,537 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp, sql
Domain
backend

Research direction

The issue is a race condition in the Resource Manager that inserts duplicate rows into the FolderPermissions table when moving folders. Start by locating the server-side folder move logic and permissions update code path, likely in the Resource Manager or FileSystem modules, then add a unique constraint on (FolderId, PermissionId, RoleId) to confirm the duplicate insert. The fix should prevent the race by checking for existing rows before insert or handling duplicates gracefully, and done means moving a folder no longer creates duplicate PermissionId/RoleId combinations.

Written by the indexing model from the issue text.

Description

Status: New
Is there an existing issue for this?
  • I have searched the existing issues
What happened?

When using the Resource Manager to move a folder from one location to another, occasionally, approximately 20% of the time, we are seeing situations where the FOlder Permissions are being duplicated.

Once a folder permission is duplicated you are stuck. The interface allows you to make a change, but it doesn't save at all.

Steps to reproduce?
  1. Before starting query to get the current permssions for your folder, you should see 1 record per PermissionId,RoleId combination.
SELECT *
FROM FolderPermissions FP
    INNER JOIN Roles R ON (FP.RoleId = R.RoleId)
WHERE FolderPath = '<YourPathHere>'
  1. Go to Site Assets
  2. Find a folder within the solution, one that has at least a few custom roles assigned
  3. Select the folder
  4. Select "Move" and select a different folder
  5. Query the permissions table again, using your new path (or update to use the existing FolderId)
  6. If the permissions are still ok, try to edit the permissions and REMOVE one of the roles and hit save
  7. Query again to validate

The failure seems to happen at either 5 or 7 randomly.

Current Behavior

In testing, depending on factors that I've yet to confirm, at times you will see a duplicated permission where the Folderid, PermissionId,AllowAccess,RoleId,CreatedByUserId, andd LastModifiedByUserId values are the same.

THe "CreatedOnDate" and "LastModifiedOnDate" values will be off, by a few thousands of a second, indicating some sort of race, or double execution issue.

It seems to be more commonly recreated if moving a folder with sub-folders, but again, not able to completely confirm.

Once this happens, there is no way to edit or clean the permissions within the system, you must manually manage/edit the permissions to remove the duplicates and then clear the cache.

Expected Behavior

Not 100% sure of the "right" fix here

Option 1 - Fix the Data Issue

We could consider fixing the DB to have a unique index to prevent bad data from ever being entered, but this will result in a complicated upgrade query.

Option 2 - Fix the "Edit" experience to Handle

Given that the root cause is harder to diagnose, it might be worthwile to fix the glitch that prevents editing of the permissions.

Option 3 - Fix the actual issue

This is harder as the exact timing/cause is unclear especially since it isn't all roles/permissions etc.

Relevant log output

Anything else?

Tested this on an early 10.0.0 installation and latest 10.3.3 as well as 10.4.0 and seeing it randomly, but unable to pinpoint exactly when.

Affected Versions

10.3.3 (latest release)

What browsers are you seeing the problem on?

Chrome

Code of Conduct
  • I agree to follow this project's Code of Conduct
Dominant language
C#
Stars
1.1k
Forks
791
Avg merge
2d 2h
Merged PRs (30d)
24

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dnnsoftware/Dnn.Platform

All issues in dnnsoftware/Dnn.Platform

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.