{% extends "base.html" %}

{% block title %}{{ _('Action Permissions') }} — {{ service_name }}{% endblock %}

{% block stylesheets %}
  {{ super() }}
    <link rel="stylesheet" href="{{ fingerprinted_static('bootstrap-select/css/bootstrap-select.min.css') }}" />
{% endblock %}

{% block scripts %}
  {{ super() }}
  <script src="{{ fingerprinted_static('bootstrap-select/js/bootstrap-select.min.js') }}"></script>
  <script src="{{ fingerprinted_static('sampledb/js/treepicker.js') }}" type="module"></script>
{% endblock %}

{% block content %}
  <h2>{{ _('Action Permissions') }}</h2>
  {% set form_url = url_for('.action_permissions', action_id=action.id) %}
  {% set fixed_user_permissions = {action.user_id: Permissions.GRANT} if action.user_id is not none else {}  %}
  {% set show_administrators = True %}
  {% set show_instrument_scientists = instrument is not none %}
  {% set show_all_users = True %}
  {% set read_permissions_description = _('Permission to view actions and use them to create objects.') %}
  {% set write_permissions_description = _('Permission to edit the schemas and descriptions of actions. Includes Read permissions.') %}
  {% set grant_permissions_description = _('Permission to grant permissions to other users. Includes Write permissions.') %}
  {% include "permissions/permissions.html" %}
  {% if user_may_edit %}
    <div class="container">
     <a href="{{ url_for('.action', action_id=action.id) }}" class="btn btn-default col-md-offset-9 col-md-3" style="margin-top: 1em; margin-bottom: 1em;">{{ _('Cancel') }}</a>
    </div>
  {% endif %}
{% endblock %}
