{% from 'components.html' import feedback %} {% from 'components/icons.html' import user_icon, team_icon %} {# Access management tab: one list of dataset access and inline grant/revoke actions. #} {% macro export_access(dataset, teams, users, entries, current_csrf, error=none, selected_subject='', concept=false, version_id=none, change_owner_url=none, grant_teams=none, grant_users=none, policy='admin_grants', may_manage=true) -%} {% set return_to = {'concept': 1 if concept else none, 'version_id': version_id or none} %} {% set fallback = url_for('dataset_detail', key=dataset.key, concept=true if concept else none, version_id=version_id, tab='access-management', _anchor='access-management') %} {% set grant_teams = teams if grant_teams is none else grant_teams %} {% set grant_users = users if grant_users is none else grant_users %} {% set emails = {} %}{% for user in users %}{% set _ = emails.update({user.id: user.email}) %}{% endfor %}

Who has access

{% if policy != 'everyone' and may_manage and not entries %}

Only the owning team has access. Add a user or team below to give them export access.

{% endif %} {% if policy == 'everyone' %}

All active users can export this dataset and use the API.

{% elif not may_manage %}

Administrators manage access to this dataset.

{% endif %} {{ feedback(error, id='governance-error', focus=true) }}
{% if policy != 'everyone' %}{% for entry, display_name in entries %} {% set is_team = entry.subject_type == 'team' %} {% endfor %}{% endif %}
Dataset access
NameTypeAccessActions
{{ team_icon() }}{{ dataset.owner_team_name }}
Team Owning team
  • View
  • Edit
  • Publish
  • Export
{% if change_owner_url %}Change owning team{% endif %}
{{ team_icon() if is_team else user_icon() }}{{ display_name }}{% if not is_team and emails.get(entry.subject_id) %}{{ emails[entry.subject_id] }}{% endif %}
{{ 'Team' if is_team else 'User' }}
  • View
  • Export
{% if may_manage %}
{% endif %}
{% if may_manage %}
{% if error %}

{{ error }}

{% endif %}
{% endif %}
{%- endmacro %}