Add adminrestrictions to some features!

Need help? Post your questions here.

Moderator: moderators

Add adminrestrictions to some features!

Postby PeeGee » Sun May 13, 2007 5:02 pm

Hi all,

Is there a string for me to add in the jsp-files if I want to restrict some features to the adminrole?

For some of my users I might like to hide for example the features under "More" and so on!

Regards / Patrik
PeeGee
 
Posts: 23
Joined: Mon Oct 16, 2006 9:58 pm
Location: Stockholm

Postby PeeGee » Wed May 30, 2007 1:04 pm

No clues anyone?

/ PG
PeeGee
 
Posts: 23
Joined: Mon Oct 16, 2006 9:58 pm
Location: Stockholm

Postby PeeGee » Wed Oct 03, 2007 11:50 am

Sindre,

Is this doable?

Regards / PG
PeeGee
 
Posts: 23
Joined: Mon Oct 16, 2006 9:58 pm
Location: Stockholm

Postby sindre_mehus » Sat Oct 06, 2007 2:07 pm

Generally speaking: no. You would have to change the underlying java code and recompile. However, for the following pages you can do it:

loadPlaylist.jsp
main.jsp
playlist.jsp
podcastReceiver.jsp
top.jsp

This is the syntax:

Code: Select all
        <c:if test="${model.user.adminRole}">
            ...  Stuff you like to restrict ...
        </c:if>


Sindre
User avatar
sindre_mehus
 
Posts: 1955
Joined: Tue Nov 29, 2005 6:19 pm
Location: Oslo, Norway

Postby swocoom » Fri Dec 10, 2010 6:10 pm

I know this is an old post, but I was running across this myself. Wanted to add restrictions on the home page so the users button was showing to only admins. Any page you want to add this on, you will need to recompile. But you can simply add the line:

map.put("user", securityService.getCurrentUser(request));

This will allow you to use:
<c:if test="${model.user.adminRole}">

on any page you wish to restrict to admin users.
swocoom
 
Posts: 11
Joined: Wed May 19, 2010 2:52 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 19 guests