turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Painter <pain...@kiasoft.com>
Subject RE: turbine security - viewing access in template
Date Fri, 16 Jan 2004 17:29:37 GMT
On Fri, 16 Jan 2004, Mark Lybarger wrote:

> 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?
> 


I have only used role based security in my applications, so I'm not sure 
if you are trying to assign users to a group and then roles to a group

 - user -> group -> multiple roles

in my TURBINE_USER_GROUP_ROLE table I have multiple roles linked to 
individual users

 - user -> multiple roles

+---------+----------+---------+
| USER_ID | GROUP_ID | ROLE_ID |
+---------+----------+---------+
|       0 |        1 |       1 |
|       0 |        1 |     100 |
|       0 |        1 |     101 |
|       0 |        1 |     102 |
|       0 |        1 |     103 |

and the hasRole("roleName") works for me in that way. hopefully this is of 
some help


-- 
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


Mime
View raw message