Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/11/2011, 10:35
MichaelParra
 
Fecha de Ingreso: enero-2009
Mensajes: 24
Antigüedad: 15 años, 3 meses
Puntos: 1
Respuesta: Sf2 Ocultar contenido dependiendo del ROL

Pues en Twig:

Código PHP:
{% if is_granted("ROLE_ADMIN") %}
    <
a href="...">Delete</a>
{% endif %} 
y en Php:

Código PHP:
<?php if ($view['security']->isGranted('ROLE_ADMIN')): ?>
    <a href="...">Delete</a>
<?php endif ?>
La referencia:

http://readthedocs.org/docs/test-sf-doc-es/en/latest/book/security/authorization.html