Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsGalleryGalleryFound the issue with download rolesFound the issue with download roles
Previous
 
Next
New Post
4/25/2006 12:33 AM
 

Hello,

         Trying to help out someone with a different problem I've found the cause for Gemini issues GAL-2075 and GAL-2337.  Users unable to download photos even if members of a download role.

         As the image controls are being created and the menu created, permissions are checked for each object from a previous call to the modulesettings table.  When it's being determined weather to add the download menu option the module is checked to see if downloads are permitted then the user is checked to see if they are SU or admin.  The last check is if user is in the download roles.

         The download rolls are loaded at module load time and are stored in the modulesettings table as type string (ie ;3;4;7).  This string is passed to the if statement for the menu download option and then to PortalSecurity.IsInRoles.  The string is split at the semi-colon and passed to PortalSecurity.IsInRoll.

         IsInRole checks to see if the string passed in matches the Rolename but it was passed the role ID. (ie passed '3' expected 'downloader'.  No match is made and False is passed back to the Gallery module.

         You can confirm this by changing the row in modulesettings from the roleID to the RoleName.  This of course breaks the configuration control so it needs to be changed back.

          I would add a routine that converts the RoleID stored in the DB to Rolename prior to checking the IsInRoles method.

         I haven't included any code with this as I found it generally isn't appreciated :)  But figured someone on the team might find it helpful in making a fix.  If someone wants the code I'll post it or I can give you the line numbers where the calls are made.  At any rate there is a duplicate issue in Gemini that could be closed.

Cheers,


Paul Davis
 
New Post
4/25/2006 12:46 AM
 

The team might not be very outspoken due to many reasons, but rest assured that your findings and other's are actually very welcome. Prior to the next release, there are two main goals among others: Implement a DAL, fix as many pending bugs as possible.

Your work is very valuable as it reduces the time needed by the team to debug the module and that will result in fixing a higher number of items. We are applying the Pareto rule so issues that have the biggest impact will be fixed first and as time permits the rest will be considered.

Thank you Paul.


Do you know the truth when you hear it?
Néstor Sánchez
The Dúnadan Raptor -->Follow Me on Twitter Now!
 
New Post
6/13/2006 7:35 AM
 

Yes, I'd like the code to fix this.

I've seen your other post to help another user and I've tried the technique to update the ModuleSettings table with the RoleName where SettingName = 'DownloadRoles'  but I couldn't get that to work.

I did SQL:

update ModuleSettings set SettingValue = ';Registered Users' where ModuleId = 1975 and SettingName = 'DownloadRoles'

Thanks in Advance

 
New Post
6/13/2006 2:59 PM
 

One thing to remember is this work around will break the configuration screen again.  So you will have to change the string in the database back to it's original number to get it to work again.

I believe this is going to be fixed in the next released version of the Gallery module so it would probably be best to wait a few more weeks.  I don't know what would happen if you make this change in the DB and then upgrade to the next version later.  It could mess you up.

Anyway,  IsInRoles splits the string on commas so the value you have in there now contains a semi-colon and won't get split.  Change the semi-colon to a comma and it should work for you.


Paul Davis
 
New Post
6/13/2006 3:17 PM
 

Portal.Security.IsInRoles() splits on semi-colons, not commas. So, the problem is the DownloadRoles string contains RoleIds not RoleNames as you originally stated.

I went ahead and changed the Gallery config property: HasDownloadPermission() to split the Ids, lookup the RoleName and check by RoleName in a loop. Not the most efficient method, but then I don't have to take apart more than one code block.

It would be nice if the DNN code had a companion method of PortalSecurity.IsInRoleIDs( string of delimited RoleIds) and PortalSecurity.IsInRoleID( RoleId as int)

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsGalleryGalleryFound the issue with download rolesFound the issue with download roles


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out