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

Fixes issue with copy module when inherit permissions is unchecked #6459

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

schotman
Copy link
Contributor

@schotman schotman commented Mar 20, 2025

Fixes #5633

Summary

When a user with edit rights (aka admin, NOT host) copies an existing module that has "inherit permissions" unchecked, no permissions are saved for the new module.

For the admin user the module "vanishes" from the page (seems to be not added). However the host user still sees the module.

reverted line 957 in ModuleInfo.cs and added code starting on line 688 in ControlBarController.cs

fix issue #5633

When a user with edit rights (aka admin, NOT host) copies an existing module that has "inherit permissions" unchecked, no permissions are saved for the new module. 

For the admin user the module "vanishes" from the page (seems to be not added). However the host user still sees the module.



fix issue dnnsoftware#5633
When a user with edit rights (aka admin, NOT host) copies an existing module that has "inherit permissions" unchecked, no permissions are saved for the new module.

For the admin user the module "vanishes" from the page (seems to be not added). However the host user still sees the module.

line 957

fix issue dnnsoftware#5633
When a user with edit rights (aka admin, NOT host) copies an existing module that has "inherit permissions" unchecked, no permissions are saved for the new module.

For the admin user the module "vanishes" from the page (seems to be not added). However the host user still sees the module.

line 688

fix issue dnnsoftware#5633
When a user with edit rights (aka admin, NOT host) copies an existing module that has "inherit permissions" unchecked, no permissions are saved for the new module.

For the admin user the module "vanishes" from the page (seems to be not added). However the host user still sees the module.

line 688

fix issue dnnsoftware#5633
@valadas valadas changed the title Fixes issue with copy module when inherit permissions is unchecked v2 Fixes issue with copy module when inherit permissions is unchecked Mar 21, 2025
newModule.PortalID = PortalSettings.Current.PortalId;
ModulePermissionController.SaveModulePermissions(newModule);
}
else
Copy link
Contributor

Choose a reason for hiding this comment

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

The if of this else has logic to set view permissions if remote is true, just thinking here if maybe we should just remove that condition would be the bug fix. Because now if the copy is on the same site it will copy all permissions (which users might not be expecting to happen). I think if at least the admin sees the module it would be good enough to fix the reported issue IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I get what you are saying, but I would see this as 'unexpected', module permissions are a deliberate act by the content manager, so IMO keeping the permissions while copying the module to another section on the site would be logical.
That being said, your suggestion solves the current bug...

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

Successfully merging this pull request may close these issues.

Module permissions lost when using "Place existing Module"
3 participants