Add in route for CCPO users page and permissions to view page
This commit is contained in:
parent
7afc24deb1
commit
41820813ed
@ -17,6 +17,7 @@ class PermissionSets(object):
|
|||||||
EDIT_PORTFOLIO_ADMIN = "edit_portfolio_admin"
|
EDIT_PORTFOLIO_ADMIN = "edit_portfolio_admin"
|
||||||
PORTFOLIO_POC = "portfolio_poc"
|
PORTFOLIO_POC = "portfolio_poc"
|
||||||
VIEW_AUDIT_LOG = "view_audit_log"
|
VIEW_AUDIT_LOG = "view_audit_log"
|
||||||
|
EDIT_CCPO_USERS = "edit_ccpo_users"
|
||||||
|
|
||||||
VIEW_APPLICATION = "view_application"
|
VIEW_APPLICATION = "view_application"
|
||||||
EDIT_APPLICATION_ENVIRONMENTS = "edit_application_environments"
|
EDIT_APPLICATION_ENVIRONMENTS = "edit_application_environments"
|
||||||
@ -56,7 +57,17 @@ ATAT_PERMISSION_SETS = [
|
|||||||
"display_name": "View Audit Log",
|
"display_name": "View Audit Log",
|
||||||
"description": "",
|
"description": "",
|
||||||
"permissions": [Permissions.VIEW_AUDIT_LOG],
|
"permissions": [Permissions.VIEW_AUDIT_LOG],
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"name": PermissionSets.EDIT_CCPO_USERS,
|
||||||
|
"display_name": "View Audit Log",
|
||||||
|
"description": "",
|
||||||
|
"permissions": [
|
||||||
|
Permissions.VIEW_CCPO_USER,
|
||||||
|
Permissions.EDIT_CCPO_USER,
|
||||||
|
Permissions.DELETE_CCPO_USER,
|
||||||
|
],
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
_PORTFOLIO_BASIC_PERMISSION_SETS = [
|
_PORTFOLIO_BASIC_PERMISSION_SETS = [
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
class Permissions(object):
|
class Permissions(object):
|
||||||
|
# ccpo permissions
|
||||||
VIEW_AUDIT_LOG = "view_audit_log"
|
VIEW_AUDIT_LOG = "view_audit_log"
|
||||||
|
VIEW_CCPO_USER = "view_ccpo_user"
|
||||||
|
EDIT_CCPO_USER = "edit_ccpo_user"
|
||||||
|
DELETE_CCPO_USER = "delete_ccpo_user"
|
||||||
|
|
||||||
# base portfolio perms
|
# base portfolio perms
|
||||||
VIEW_PORTFOLIO = "view_portfolio"
|
VIEW_PORTFOLIO = "view_portfolio"
|
||||||
|
@ -132,6 +132,12 @@ def activity_history():
|
|||||||
return render_template("audit_log/audit_log.html", audit_events=audit_events)
|
return render_template("audit_log/audit_log.html", audit_events=audit_events)
|
||||||
|
|
||||||
|
|
||||||
|
@bp.route("/ccpo-users")
|
||||||
|
@user_can(Permissions.VIEW_CCPO_USER, message="view ccpo users")
|
||||||
|
def ccpo_users():
|
||||||
|
return render_template("ccpo/users.html")
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/about")
|
@bp.route("/about")
|
||||||
def about():
|
def about():
|
||||||
return render_template("about.html")
|
return render_template("about.html")
|
||||||
|
@ -31,6 +31,7 @@ _ALL_PERMS = [
|
|||||||
PermissionSets.EDIT_PORTFOLIO_ADMIN,
|
PermissionSets.EDIT_PORTFOLIO_ADMIN,
|
||||||
PermissionSets.PORTFOLIO_POC,
|
PermissionSets.PORTFOLIO_POC,
|
||||||
PermissionSets.VIEW_AUDIT_LOG,
|
PermissionSets.VIEW_AUDIT_LOG,
|
||||||
|
PermissionSets.EDIT_CCPO_USERS,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
9
templates/ccpo/users.html
Normal file
9
templates/ccpo/users.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class='col'>
|
||||||
|
|
||||||
|
CCPO Stuff goes here
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
@ -120,6 +120,16 @@ def test_atst_activity_history_access(get_url_assert_status):
|
|||||||
get_url_assert_status(rando, url, 404)
|
get_url_assert_status(rando, url, 404)
|
||||||
|
|
||||||
|
|
||||||
|
# atst.ccpo_users
|
||||||
|
def test_atst_ccpo_users_access(get_url_assert_status):
|
||||||
|
ccpo = user_with(PermissionSets.EDIT_CCPO_USERS)
|
||||||
|
rando = user_with()
|
||||||
|
|
||||||
|
url = url_for("atst.ccpo_users")
|
||||||
|
get_url_assert_status(ccpo, url, 200)
|
||||||
|
get_url_assert_status(rando, url, 404)
|
||||||
|
|
||||||
|
|
||||||
# applications.access_environment
|
# applications.access_environment
|
||||||
def test_applications_access_environment_access(get_url_assert_status):
|
def test_applications_access_environment_access(get_url_assert_status):
|
||||||
dev = UserFactory.create()
|
dev = UserFactory.create()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user