Add CREATE_CCPO_USER permission, create context processor for ATAT so user_can and permissions can be used in the template, add placeholder button for adding new CCPO user
This commit is contained in:
parent
93c39fd7e7
commit
8420a78392
@ -64,6 +64,7 @@ ATAT_PERMISSION_SETS = [
|
||||
"description": "",
|
||||
"permissions": [
|
||||
Permissions.VIEW_CCPO_USER,
|
||||
Permissions.CREATE_CCPO_USER,
|
||||
Permissions.EDIT_CCPO_USER,
|
||||
Permissions.DELETE_CCPO_USER,
|
||||
],
|
||||
|
@ -2,6 +2,7 @@ class Permissions(object):
|
||||
# ccpo permissions
|
||||
VIEW_AUDIT_LOG = "view_audit_log"
|
||||
VIEW_CCPO_USER = "view_ccpo_user"
|
||||
CREATE_CCPO_USER = "create_ccpo_user"
|
||||
EDIT_CCPO_USER = "edit_ccpo_user"
|
||||
DELETE_CCPO_USER = "delete_ccpo_user"
|
||||
|
||||
|
@ -24,10 +24,12 @@ from atst.domain.common import Paginator
|
||||
from atst.domain.portfolios import Portfolios
|
||||
from atst.domain.authz.decorator import user_can_access_decorator as user_can
|
||||
from atst.models.permissions import Permissions
|
||||
from atst.utils.context_processors import atat as atat_context_processor
|
||||
from atst.utils.flash import formatted_flash as flash
|
||||
|
||||
|
||||
bp = Blueprint("atst", __name__)
|
||||
bp.context_processor(atat_context_processor)
|
||||
|
||||
|
||||
@bp.route("/")
|
||||
|
@ -119,3 +119,10 @@ def portfolio():
|
||||
"funding_end_date": funding_end_date,
|
||||
"funded": funded,
|
||||
}
|
||||
|
||||
|
||||
def atat():
|
||||
return {
|
||||
"permissions": Permissions,
|
||||
"user_can": user_can_view,
|
||||
}
|
||||
|
@ -1,27 +1,36 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% from "components/icon.html" import Icon %}
|
||||
|
||||
{% block content %}
|
||||
<div class='col'>
|
||||
<div class="h2">
|
||||
CCPO Users
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>DoD ID</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users %}
|
||||
<div class='col'>
|
||||
<div class="h2">
|
||||
CCPO Users
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ user.full_name }}</td>
|
||||
<td>{{ user.email }}</td>
|
||||
<td>{{ user.dod_id }}</td>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>DoD ID</th>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<td>{{ user.full_name }}</td>
|
||||
<td>{{ user.email }}</td>
|
||||
<td>{{ user.dod_id }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% if user_can(permissions.CREATE_CCPO_USER) %}
|
||||
<a class="icon-link modal-link" v-on:click="openModal()">
|
||||
Add new CCPO user {{ Icon("plus") }}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user