turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Lybarger" <Mark.Lybar...@CBC-Companies.com>
Subject RE: turbine security - viewing access in template
Date Fri, 16 Jan 2004 17:20:37 GMT
i don't know if i have default group setup or not, but it doesn't seem to work i'm using:

#set ($role = "Event")
#if ($data.getACL().hasRole($role))
	User has role $role
	<br>
#end

where the user definately had that role in all their groups. and nothing is displayed.  i
try to add a group but again nothing:

#set ($role = "Event")
#set ($group = "Admin")
#if ($data.getACL().hasRole($role,$group))
	User has role $role, $group
	<br>
#end

i am able to use the following:

#set ($permission = "entry")
#set ($group = "Admin")
#if ( $data.getACL().hasPermission("entry","Admin") )
	User has permission ${permission}, group ${group}
	
#end

and it displays that the user has a particular permission in a group. does the getACL().hasRole(
role, group) not work the way i'm using it?

> -----Original Message-----
> From: Jeff Painter [mailto:painter@kiasoft.com]
> Sent: Wednesday, January 14, 2004 11:03 AM
> To: Turbine Users List
> Subject: RE: turbine security - viewing access in template
> 
> 
> 
> in your velocity template you can do the following
> 
> 	<select>
> 		#if ( $data.getACL().hasRole("sales") || 
> $data.getACL().hasRole("shipping") )
> 		  <option value="0">shipping</option>
> 		#end
> 
> 		#if ( $data.getACL().hasRole("admin") )
> 		  <option value="1">admin</option>
> 		#end
> 	</select>
> 
> On Wed, 14 Jan 2004, Mark Lybarger wrote:
> 
> > 
> > 
> > >  -----Original Message-----
> > > From: 	Mark Lybarger  
> 
> > > basicaly, i'm after a method which i can check a users 
> > > security (see if user's group has a particular role) from 
> > > within a velocity template.  i have combo box that i need to 
> > > display if the user is of a c ertain security, otherwise, i 
> > > need to disable the combo box and have the default option be 
> > > the selected option. ie, certain users can override shipping 
> > > costs when submitting an order or something like that. 
> > > 
> > > thanks!
> > > 
> > > ~mark
> > > 
> 
> 
> Regards,
> 
> Jeffery Painter
> 
> - --
> painter@kiasoft.com                     http://kiasoft.com
> PGP FP: 9CE8 83A2 33FA 32B1 0AB1  4E62 E4CB E4DA 5913 EFBC
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
>  
> iD8DBQE/qEQE5Mvk2lkT77wRAnMJAJ9vJ6qOkg/mvqqIpz7troCEQJ8bFACglu/U
> YNXabx7DZOV2Hd9LwSTmGpY=
> =dWiu
> -----END PGP SIGNATURE-----
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> 
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.560 / Virus Database: 352 - Release Date: 1/8/2004
>  
> 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 1/8/2004
 


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Mime
View raw message