mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 02:13:15 +00:00
PHRAS-508_acl-cache
- wip
This commit is contained in:
@@ -35,7 +35,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() }) }}">{{ 'phraseanet:: details' | trans }}</a></li>
|
||||
</ul>
|
||||
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, constant('\\ACL::COLL_MANAGE')) %}
|
||||
<div class="well well-small">
|
||||
<h5>{{ 'admin::collection:: Gestionnaires des commandes' | trans }}</h5>
|
||||
<form id="admin_adder" action="{{ path('admin_collection_submit_order_admins', { 'bas_id' : bas_id }) }}" method="post" style="margin:0;">
|
||||
@@ -144,7 +144,7 @@
|
||||
<h5>{{ 'admin::base:collection: minilogo actuel' | trans }}</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.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, constant('\\ACL::COLL_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>
|
||||
@@ -152,7 +152,7 @@
|
||||
</button>
|
||||
</form>
|
||||
{% endif%}
|
||||
{% elseif app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
|
||||
{% elseif app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, constant('\\ACL::COLL_MANAGE')) %}
|
||||
<span>{{ 'admin::base:collection: aucun fichier (minilogo, watermark ...)' | trans }}</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">
|
||||
@@ -169,7 +169,7 @@
|
||||
<h5>{{ "Watermark" | trans }}</h5>
|
||||
{% if collection.getWatermark(bas_id) is not empty %}
|
||||
<div class="thumbnail">{{ collection.getWatermark(bas_id)| raw }}</div>
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, constant('\\ACL::COLL_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>
|
||||
@@ -177,7 +177,7 @@
|
||||
</button>
|
||||
</form>
|
||||
{% endif%}
|
||||
{% elseif app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
|
||||
{% elseif app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, constant('\\ACL::COLL_MANAGE')) %}
|
||||
<span>{{ 'admin::base:collection: aucun fichier (minilogo, watermark ...)' | trans }}</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">
|
||||
@@ -194,7 +194,7 @@
|
||||
<h5>{{ "Stamp logo" | trans }}</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.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, constant('\\ACL::COLL_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>
|
||||
@@ -202,7 +202,7 @@
|
||||
</button>
|
||||
</form>
|
||||
{% endif%}
|
||||
{% elseif app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, 'manage') %}
|
||||
{% elseif app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(bas_id, constant('\\ACL::COLL_MANAGE')) %}
|
||||
<span>{{ 'admin::base:collection: aucun fichier (minilogo, watermark ...)' | trans }}</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">
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(["canadmin"]) | length > 0 %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).get_granted_base([constant('\\ACL::CANADMIN')]) | length > 0 %}
|
||||
<select id="othcollsel" name="othcollsel" disabled>
|
||||
<option>{{ "choisir" | trans }}</option>
|
||||
{% for collection in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(["canadmin"]) %}
|
||||
{% for collection in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base([constant('\\ACL::CANADMIN')]) %}
|
||||
<option value="{{ collection.get_base_id() }}">{{ collection.get_label(app['locale']) }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
<li>
|
||||
<form class="form-inline" method="post" action="{{ path('admin_database_mount_collection', {'databox_id': databox.get_sbas_id(), 'collection_id' : collId }) }}">
|
||||
{% trans with {'%name%' : name} %}Monter la collection %name%{% endtrans %}<br/>
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(["canadmin"]) | length > 0 %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).get_granted_base([constant('\\ACL::CANADMIN')]) | length > 0 %}
|
||||
<label for="othcollsel">{{ "admin::base:collection: Vous pouvez choisir une collection de reference pour donenr des acces" | trans }}</label>
|
||||
<select id="othcollsel" name="othcollsel" >
|
||||
<option value="">{{ "choisir" | trans }}</option>
|
||||
|
||||
@@ -347,16 +347,16 @@
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'actif', users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_canputinalbum" title="{{ 'Allowed to add in basket' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'canputinalbum', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANPUTINALBUM'), users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_candwnldpreview" title="{{ 'Access to preview' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'candwnldpreview', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANDWNLDPREVIEW'), users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_nowatermark" title="{{ 'Remove watermark' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'nowatermark', users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_candwnldhd" title="{{ 'Access to HD' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'candwnldhd', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANDWNLDHD'), users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_cancmd" title="{{ 'Allowed to order' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'cancmd', users, 'base')}}
|
||||
@@ -395,34 +395,34 @@
|
||||
<td style="text-align:center;width:100px;"></td>
|
||||
|
||||
<td class="users_col case_right_canaddrecord" title="{{ 'Allowed to add' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'canaddrecord', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANADDRECORD'), users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_canmodifrecord" title="{{ 'Allowed to edit' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'canmodifrecord', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANMODIFRECORD'), users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_chgstatus" title="{{ 'Allowed to change statuses' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'chgstatus', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CHGSTATUS'), users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_candeleterecord" title="{{ 'Allowed to delete' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'candeleterecord', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANDELETERECORD'), users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_imgtools" title="{{ 'Access to image tools' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'imgtools', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::IMGTOOLS'), users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_canadmin" title="{{ 'Manage users' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'canadmin', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANADMIN'), users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_canreport" title="{{ 'Allowed to access report' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'canreport', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANREPORT'), users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_canpush" title="{{ 'Allowed to push' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'canpush', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANPUSH'), users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_manage" title="{{ 'Manage collection' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'manage', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::MANAGE'), users, 'base')}}
|
||||
</td>
|
||||
<td class="users_col case_right_modify" title="{{ 'Manage values lists' | trans }}">
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, 'modify_struct', users, 'base')}}
|
||||
{{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::MODIFY_STRUCT'), users, 'base')}}
|
||||
</td>
|
||||
<td colspan="5">
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right('manageusers') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANADMIN')) %}
|
||||
<li class="{% if feature == 'users' %}selected{% endif %}">
|
||||
<a target="right" href="{{ path('admin_users_search') }}" class="ajax zone_editusers">
|
||||
<img src="/assets/admin/images/Users.png" />
|
||||
@@ -152,7 +152,7 @@
|
||||
{% set seeUsrGene = false %}
|
||||
|
||||
{% for coll in databox.get_collections() %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base( coll.get_base_id() , 'canadmin') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base( coll.get_base_id() , constant('\\ACL::CANADMIN')) %}
|
||||
{% set seeUsrGene = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
@@ -167,9 +167,9 @@
|
||||
{% endif %}
|
||||
|
||||
{% for collection in databox.get_collections()|sort_collections %}
|
||||
{% if (collection.get_base_id() in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(['canadmin'])|keys
|
||||
or collection.get_base_id() in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(['manage'])|keys
|
||||
or collection.get_base_id() in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base(['modify_struct'])|keys) %}
|
||||
{% if (collection.get_base_id() in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base([constant('\\ACL::CANADMIN')])|keys
|
||||
or collection.get_base_id() in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base([constant('\\ACL::MANAGE')])|keys
|
||||
or collection.get_base_id() in app.getAclForUser(app.getAuthenticatedUser()).get_granted_base([constant('\\ACL::MODIFY_STRUCT')])|keys) %}
|
||||
|
||||
{% if feature == 'collection' and featured == collection.get_base_id() %}
|
||||
{% set coll_selected = true %}
|
||||
@@ -185,7 +185,7 @@
|
||||
</div>
|
||||
<ul>
|
||||
|
||||
{% if (app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(collection.get_base_id(), 'modify_struct')) %}
|
||||
{% if (app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(collection.get_base_id(), constant('\\ACL::COLL_MODIFY_STRUCT'))) %}
|
||||
<li>
|
||||
<a target="right" href="{{ path('admin_collection_display_suggested_values', { 'bas_id' : collection.get_base_id() }) }}" class="ajax">
|
||||
<img src="/assets/common/images/icons/foldph20open_0.gif"/>
|
||||
@@ -194,7 +194,7 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(collection.get_base_id(), 'canadmin') %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_right_on_base(collection.get_base_id(), constant('\\ACL::CANADMIN')) %}
|
||||
<li>
|
||||
<a target="right" href="{{ path('admin_users_search', { 'base_id' : [ collection.get_base_id() ] }) }}" class="ajax">
|
||||
<img src="/assets/admin/images/Users.png"/>
|
||||
|
||||
Reference in New Issue
Block a user