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

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...How to see if a user has edit rights, when viewing the pageHow to see if a user has edit rights, when viewing the page
Previous
 
Next
New Post
5/4/2009 3:24 AM
 

Hi,

I want to show users with edit rights some extra things on a page. I can't use the isEditable boolean because it's only set to true when a user selects the "Edit" checkbox at the top of the page.

So, i need to find a way to see if a user has edit rights, also when he's just viewing the page.

Does somebody know how i can do this ?

Thanks

 
New Post
5/6/2009 10:40 AM
 

Nobody ? :(

 
New Post
5/6/2009 11:32 AM
 

I would recommend taking a look at the code for IsEditable in the SOURCE package and seeing how it is checking for page edit rights, you could do the same (without requiring edit mode) in your module.

 Public ReadOnly Property IsEditable() As Boolean
            Get

                ' Perform tri-state switch check to avoid having to perform a security
                ' role lookup on every property access (instead caching the result)
                If _isEditable = 0 Then

                    Dim blnPreview As Boolean = (PortalSettings.UserMode = PortalSettings.Mode.View)
                    If PortalSettings.ActiveTab.ParentId = PortalSettings.AdminTabId Or PortalSettings.ActiveTab.ParentId = PortalSettings.SuperTabId Then
                        blnPreview = False
                    End If

                    Dim blnHasModuleEditPermissions As Boolean = False
                    If Not _moduleConfiguration Is Nothing Then
                        blnHasModuleEditPermissions = (PortalSecurity.IsInRoles(_moduleConfiguration.AuthorizedEditRoles) = True) OrElse _
                            (PortalSecurity.IsInRoles(PortalSettings.ActiveTab.AdministratorRoles) = True) OrElse _
                            (PortalSecurity.IsInRoles(PortalSettings.AdministratorRoleName) = True)
                    End If

                    If blnPreview = False And blnHasModuleEditPermissions = True Then
                        _isEditable = 1
                    Else
                        _isEditable = 2
                    End If
                End If

                Return _isEditable = 1
            End Get
        End Property


Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
5/7/2009 2:27 AM
 

Thank you,

that seems to be a good idea, i'll give it a try

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...How to see if a user has edit rights, when viewing the pageHow to see if a user has edit rights, when viewing the page


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