forked from enviPath/enviPy
View Package Perm
This commit is contained in:
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
{% block action_modals %}
|
{% block action_modals %}
|
||||||
{% include "modals/objects/edit_package_modal.html" %}
|
{% include "modals/objects/edit_package_modal.html" %}
|
||||||
|
{% include "modals/objects/view_package_permissions_modal.html" %}
|
||||||
{% include "modals/objects/edit_package_permissions_modal.html" %}
|
{% include "modals/objects/edit_package_permissions_modal.html" %}
|
||||||
{% include "modals/objects/publish_package_modal.html" %}
|
{% include "modals/objects/publish_package_modal.html" %}
|
||||||
{% include "modals/objects/set_license_modal.html" %}
|
{% include "modals/objects/set_license_modal.html" %}
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
<i class="glyphicon glyphicon-bullhorn"></i> Publish Package</a
|
<i class="glyphicon glyphicon-bullhorn"></i> Publish Package</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
role="button"
|
role="button"
|
||||||
@ -31,6 +32,7 @@
|
|||||||
<i class="glyphicon glyphicon-bullhorn"></i> Export Package as JSON</a
|
<i class="glyphicon glyphicon-bullhorn"></i> Export Package as JSON</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
|
{% if meta.can_edit %}
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
role="button"
|
role="button"
|
||||||
@ -48,3 +50,13 @@
|
|||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if not meta.can_edit %}
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
role="button"
|
||||||
|
onclick="document.getElementById('view_package_permissions_modal').showModal(); return false;"
|
||||||
|
>
|
||||||
|
<i class="glyphicon glyphicon-user"></i> View Permissions</a
|
||||||
|
>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
147
templates/modals/objects/view_package_permissions_modal.html
Normal file
147
templates/modals/objects/view_package_permissions_modal.html
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
{% load static %}
|
||||||
|
<!-- Edit Package Permissions -->
|
||||||
|
<dialog
|
||||||
|
id="view_package_permissions_modal"
|
||||||
|
class="modal"
|
||||||
|
x-data="{}"
|
||||||
|
>
|
||||||
|
<div class="modal-box max-w-2xl">
|
||||||
|
<!-- Header -->
|
||||||
|
<h3 class="text-lg font-bold">Current Permissions</h3>
|
||||||
|
|
||||||
|
<!-- Close button (X) -->
|
||||||
|
<form method="dialog">
|
||||||
|
<button class="btn btn-sm btn-circle btn-ghost absolute top-2 right-2">
|
||||||
|
✕
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- Body -->
|
||||||
|
<div class="py-4">
|
||||||
|
<p class="mb-4">
|
||||||
|
Current permissions for this package.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<!-- User Permissions -->
|
||||||
|
{% if user_permissions %}
|
||||||
|
<div class="divider">User Permissions</div>
|
||||||
|
<div class="space-y-2">
|
||||||
|
<div class="grid grid-cols-12 gap-2 items-center">
|
||||||
|
<div class="col-span-5 truncate"></div>
|
||||||
|
<div class="col-span-2 text-center">Read</div>
|
||||||
|
<div class="col-span-2 text-center">Write</div>
|
||||||
|
<div class="col-span-2 text-center">Owner</div>
|
||||||
|
<div class="col-span-1"></div>
|
||||||
|
</div>
|
||||||
|
{% for up in user_permissions %}
|
||||||
|
<div class="grid grid-cols-12 gap-2 items-center">
|
||||||
|
<div class="col-span-5 truncate">
|
||||||
|
{{ up.user.username }}
|
||||||
|
{% if not up.user.is_active %}<i>(inactive)</i>{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="col-span-2 text-center">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
name="read"
|
||||||
|
id="read_{{ up.user.uuid }}"
|
||||||
|
class="checkbox"
|
||||||
|
{% if up.has_read %}checked{% endif %}
|
||||||
|
onclick="return false;"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-2 text-center">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
name="write"
|
||||||
|
id="write_{{ up.user.uuid }}"
|
||||||
|
class="checkbox"
|
||||||
|
{% if up.has_write %}checked{% endif %}
|
||||||
|
onclick="return false;"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-2 text-center">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
name="owner"
|
||||||
|
id="owner_{{ up.user.uuid }}"
|
||||||
|
class="checkbox"
|
||||||
|
{% if up.has_all %}checked{% endif %}
|
||||||
|
onclick="return false;"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Group Permissions -->
|
||||||
|
{% if group_permissions %}
|
||||||
|
<div class="divider">Group Permissions</div>
|
||||||
|
<div class="space-y-2">
|
||||||
|
<div class="grid grid-cols-12 gap-2 items-center">
|
||||||
|
<div class="col-span-5 truncate"></div>
|
||||||
|
<div class="col-span-2 text-center">Read</div>
|
||||||
|
<div class="col-span-2 text-center">Write</div>
|
||||||
|
<div class="col-span-2 text-center">Owner</div>
|
||||||
|
<div class="col-span-1"></div>
|
||||||
|
</div>
|
||||||
|
{% for gp in group_permissions %}
|
||||||
|
|
||||||
|
<div class="grid grid-cols-12 gap-2 items-center">
|
||||||
|
<div class="col-span-5 truncate">
|
||||||
|
{{ gp.group.name|safe }}
|
||||||
|
</div>
|
||||||
|
<div class="col-span-2 text-center">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
name="read"
|
||||||
|
id="read_{{ gp.group.uuid }}"
|
||||||
|
class="checkbox"
|
||||||
|
{% if gp.has_read %}checked{% endif %}
|
||||||
|
onclick="return false;"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-2 text-center">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
name="write"
|
||||||
|
id="write_{{ gp.group.uuid }}"
|
||||||
|
class="checkbox"
|
||||||
|
{% if gp.has_write %}checked{% endif %}
|
||||||
|
onclick="return false;"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-2 text-center">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
name="owner"
|
||||||
|
id="owner_{{ gp.group.uuid }}"
|
||||||
|
class="checkbox"
|
||||||
|
{% if gp.has_all %}checked{% endif %}
|
||||||
|
onclick="return false;"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Footer -->
|
||||||
|
<div class="modal-action">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn"
|
||||||
|
onclick="this.closest('dialog').close()"
|
||||||
|
>
|
||||||
|
Close
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Backdrop -->
|
||||||
|
<form method="dialog" class="modal-backdrop">
|
||||||
|
<button>close</button>
|
||||||
|
</form>
|
||||||
|
</dialog>
|
||||||
Reference in New Issue
Block a user