Solved

Dotnetnuke refresh menu items after role assignment

Posted on 2010-11-09
2
784 Views
Last Modified: 2012-05-10
Dear experts,

I have created a dotnetnuke module for users to add themselves to a security role "Document Editing". I have assigned the menu item "Documents" to the security role.

However, the menu item "Documents" does not appear immediately when the user add themselves to the role. It only appears after about a minute.

How can I force the menu items to appear immediately? I am not sure whether this should be a server-side or client-side issue. Tried using javascript postback but with no luck.

Thanks!
0
Comment
Question by:quziguang
2 Comments
 
LVL 6

Accepted Solution

by:
ErikVB earned 500 total points
ID: 34099854
In DNN rolemembership are persisted on the client side by way of cookies. So, if you modify role membership of a user, you need to clear that cookie. You can do this easily by calling DotNetNuke.Security.PortalSecurity.ClearRoles()
Once the cookie is cleared, DNN will re-create it with the new roleinfo, which includes the new membership. This will make the menu filter properly to the new rolemembership of the user, and should make the previously hidden menu visible
0
 

Author Comment

by:quziguang
ID: 34105132
Thanks - that was really helpful!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Read about why website design really matters in today's demanding market.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now