Adding a link to the Administration Bar that has permissions

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
4/15/2014 6:42:13 AM
Gravatar
Total Posts 19

Adding a link to the Administration Bar that has permissions

Hey,

I have been looking into this for the past few days. I have added a link to the Admin bar(gray bar at the bottom) using normal HTML (<a href>). I cant seem to figure out how to make the links show up only for select permissions. I have tried using the visableToRoles in the <a> tag, but have not gotten the desired result. If I need to use the <portal:> in conjunction how do a add a new "id". I don't want to give the user permission to the admin menu. 

 

Any help would be amazing.

 

Thanks.

4/15/2014 7:12:22 PM
Gravatar
Total Posts 4

Re: Adding a link to the Administration Bar that has permissions

I guess this would be better addressed to the Developer Forum:

https://www.mojoportal.com/Forums/ForumView.aspx?pageid=5&f=9~1

4/16/2014 10:52:31 AM
Gravatar
Total Posts 18439

Re: Adding a link to the Administration Bar that has permissions

Hi,

If you use the very latest version of mojoPortal (2.4.0.3) we have a new control that can do this kind of thing. You can put it in layout.master as a toolbar link for example and it will only be visible according to the roles you specify

<portal:RoleEnabledHyperlink id="lnk1" runat="server" RelativeUrl="/somepageurl" AllowedRoles="Admins;Content Administrators;" Text="My Page Name"  />

Hope that helps,

Joe

4/16/2014 10:58:30 AM
Gravatar
Total Posts 18439

Re: Adding a link to the Administration Bar that has permissions

actually this control has existed since 2012-09-23 so it may not require the very latest version, but any version newer than that date

4/16/2014 4:55:04 PM
Gravatar
Total Posts 19

Re: Adding a link to the Administration Bar that has permissions

Oh wow this is perfect the only problem I'm hitting now is that the empty gray bar is still showing when logged out. Is it the same problem from this post?  if so, can I set the RoleEnabledHyperlink   Visible = false? can that only be done in source control?

4/23/2014 11:38:47 AM
Gravatar
Total Posts 18439

Re: Adding a link to the Administration Bar that has permissions

Hi,

You are right, AutoHidePanel was not really considered when RoleEnabledHyperlink was created so it was just not rendering if the user is not in an allowed role. I have just fixed to to set the Visible property to false so it can be detected by AutoHidePanel, where previously the Visible property would be true even if it wasn't going to render.

This is fixed in the source code repository now so it will be fixed in the next release.

Thanks,

Joe

You must sign in to post in the forums. This thread is closed to new posts.