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

Menu mode doesn't respect per UserID permission #46

Open
giovaboy opened this issue Apr 23, 2020 · 2 comments
Open

Menu mode doesn't respect per UserID permission #46

giovaboy opened this issue Apr 23, 2020 · 2 comments
Labels

Comments

@giovaboy
Copy link

Describe the bug

If setted to "Menu", the links module will only reflect per RoleID permissions

Software Versions

  • DNN: v. 09.02.02 (178)
  • Module: 7.0.1

To Reproduce

Steps to reproduce the behavior:

  1. Add a Links module
  2. Apply the Menu mode in Module Settings
  3. Point the module to any page with custom per User permissions
  4. Look at your Links module, is not reflecting those permissions

Expected behavior

User permissions to be reflected.

@giovaboy
Copy link
Author

I've fixed it with this code in the Switch-Case for the Menu Type in "Links.ascx.cs", but I'm not ready to commit a pull request:

if (MenuAllUser.Equals("No"))
{
  foreach (var role in tabinfo.TabPermissions.ToList())
  {
    if (role.AllowAccess)
	{
	  if (role.UserID > 0)
        link.GrantRoles += "U" + role.UserID + ";";
      else
        link.GrantRoles += role.RoleID + ";";
    }
  }
}

...then in the final if:


if (isInARole | link.GrantRoles.Contains("-2") | link.GrantRoles.Contains("-1") | link.GrantRoles.Contains("U" + this.UserInfo.UserID) | this.UserInfo.IsSuperUser | this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName))
  linksToShow.Add(link); 

@valadas
Copy link
Member

valadas commented Feb 2, 2021

Can I ask why you are not ready for a pull request ?

@valadas valadas added the bug label Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants