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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Get user permissions for a module instance?Get user permissions for a module instance?
Previous
 
Next
New Post
12/27/2007 3:05 PM
 

I have an ASPX page that needs to process information for a module and need to check the user's permissions for that module (essentially need an "IsEditable" property).  Now, it seems I could try to load the ModuleInfo from the ModuleController and then iterate through the modulepermissions collection, but I'm not really sure what to look for.  Anybody shed some light on how to find out if the currently logged in user has Edit rights for the module?  I'd imagine I'll need both the moduleid AND the tabid to get at this information, right?


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
New Post
12/27/2007 3:27 PM
 

You're trying to find out if a user has edit rights for a different module than the one you're coding, right?  In the module, there is an IsEditable property for that situation.

For a different module, use DotNetNuke.Security.PortalSecurity.HasEditPermissions(moduleId, tabId);

Hope it helps,


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
12/27/2007 3:46 PM
 

Well... technically it is the same module but it is an "external" ASPX page (not an ASCX deriving from ModuleBase or anything like that -- I open the ASPX page using Telerik RadWindow as a "detail" page for a calendar event).  Here is what I've done and seems to work (experimenting after posting the original question):

return DotNetNuke.Security.Permissions.ModulePermissionController.HasModulePermission(evt.ModuleId, _tabId, "EDIT");

I access the page and pass in a parameter for an "EventId" (which I load the data object for and pass that in, the data object has a moduleid reference, as seen above).  I also pass the tabid for the page that contains the module so I can get that, then use the "EDIT" key.  I'll have to look at the method you suggested, seems like it would get me the same results.

Thanks a bunch though!

**EDIT** I looked at that other method (DotNetNuke.Security.PortalSecurity.HasEditPermissions(evt.ModuleId, _tabId);) and it shows as being deprecated and wants me to use a much more convoluted method instead.  I think I'll stick with the method I'm using unless a core member tells me I'm naughty by doing so.


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Get user permissions for a module instance?Get user permissions for a module instance?


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