Use ACL service provider to get user's ACL

This commit is contained in:
Nicolas Le Goff
2013-10-31 11:13:14 +01:00
parent 21eec6dbbe
commit 1fdf30c6af
117 changed files with 619 additions and 619 deletions

View File

@@ -34,7 +34,7 @@
<li>{{ collection.get_record_amount() }} records <a class="ajax" target="rights" href="{{ path('admin_collection_display_document_details', { 'bas_id' : collection.get_base_id() }) }}">{% trans 'phraseanet:: details' %}</a></li>
</ul>
{% if app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %}
<div class="well well-small">
<h5>{% trans 'admin::collection:: Gestionnaires des commandes' %}</h5>
<form id="admin_adder" action="{{ path('admin_collection_submit_order_admins', { 'bas_id' : bas_id }) }}" method="post" style="margin:0;">
@@ -143,7 +143,7 @@
<h5>{% trans 'admin::base:collection: minilogo actuel' %}</h5>
{% if collection.getLogo(bas_id, app) is not empty %}
<div class="thumbnail" style="width:120px;height:24px;margin-top:5px;margin-bottom:5px">{{ collection.getLogo(bas_id, app) | raw }}</div>
{% if app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %}
<form method="post" action="{{ path('admin_collection_delete_logo', { 'bas_id' : bas_id }) }}" style="margin:0;">
<button class="btn btn-danger btn-mini" >
<i class="icon-trash icon-white"></i>
@@ -151,7 +151,7 @@
</button>
</form>
{% endif%}
{% elseif app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
{% elseif app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %}
<span>{% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}</span>
<form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="{{ path('admin_collection_submit_logo', { 'bas_id' : bas_id }) }}" style="margin:0;">
<span class="btn btn-success fileinput-button">
@@ -168,7 +168,7 @@
<h5>{% trans "Watermark" %}</h5>
{% if collection.getWatermark(bas_id) is not empty %}
<div class="thumbnail">{{ collection.getWatermark(bas_id)| raw }}</div>
{% if app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %}
<form method="post" action="{{ path('admin_collection_delete_watermark', { 'bas_id' : bas_id }) }}" style="margin:0;">
<button class="btn btn-danger btn-mini">
<i class="icon-trash icon-white"></i>
@@ -176,7 +176,7 @@
</button>
</form>
{% endif%}
{% elseif app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
{% elseif app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %}
<span>{% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}</span>
<form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="{{ path('admin_collection_submit_watermark', { 'bas_id' : bas_id }) }}" style="margin:0;">
<span class="btn btn-success fileinput-button">
@@ -193,7 +193,7 @@
<h5>{% trans "Stamp logo" %}</h5>
{% if collection.getStamp(bas_id) is not empty %}
<div class="thumbnail" style="max-height:120px;max-width:260px">{{ collection.getStamp(bas_id)| raw }}</div>
{% if app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %}
<form method="post" action="{{ path('admin_collection_delete_stamp', { 'bas_id' : bas_id }) }}" style="margin:0;">
<button class="btn btn-danger btn-mini">
<i class="icon-trash icon-white"></i>
@@ -201,7 +201,7 @@
</button>
</form>
{% endif%}
{% elseif app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
{% elseif app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %}
<span>{% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}</span>
<form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="{{ path('admin_collection_submit_stamp', { 'bas_id' : bas_id }) }}" style="margin:0;">
<span class="btn btn-success fileinput-button">
@@ -218,7 +218,7 @@
<h5>{% trans 'admin::base:collection: image de presentation : ' %}</h5>
{% if collection.getPresentation(bas_id) is not empty %}
<div class="thumbnail" style="width:650px;height:200px">{{ collection.getPresentation(bas_id)| raw }}</div>
{% if app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
{% if app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %}
<form method="post" action="{{ path('admin_collection_delete_banner', { 'bas_id' : bas_id }) }}" style="margin:0;">
<button class="btn btn-danger btn-mini">
<i class="icon-trash icon-white"></i>
@@ -226,7 +226,7 @@
</button>
</form>
{% endif%}
{% elseif app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %}
{% elseif app['acl'].get(app['authentication'].getUser()).has_right_on_base(bas_id, 'manage') %}
<span>{% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}</span>
<form class="fileupload no-ajax" enctype="multipart/form-data" method="post" action="{{ path('admin_collection_submit_banner', { 'bas_id' : bas_id }) }}" style="margin:0;">
<span class="btn btn-success fileinput-button">

View File

@@ -32,10 +32,10 @@
</div>
<div class="control-group">
<div class="controls">
{% if app['authentication'].getUser().ACL().get_granted_base(["canadmin"]) | length > 0 %}
{% if app['acl'].get(app['authentication'].getUser()).get_granted_base(["canadmin"]) | length > 0 %}
<select id="othcollsel" name="othcollsel" disabled>
<option>{% trans "choisir" %}</option>
{% for collection in app['authentication'].getUser().ACL().get_granted_base(["canadmin"]) %}
{% for collection in app['acl'].get(app['authentication'].getUser()).get_granted_base(["canadmin"]) %}
<option value="{{ collection.get_base_id() }}">{{ collection.get_label(app['locale.I18n']) }}</option>
{% endfor %}
</select>