Infer if the user has no environment role

This commit is contained in:
Montana 2018-09-20 15:04:33 -04:00
parent e9f9ff0cd5
commit a8b777acda
3 changed files with 3 additions and 42 deletions

View File

@ -186,45 +186,6 @@ ENVIRONMENT_ROLES = [
),
]
ENVIRONMENT_ROLES = [
("no_access", {"name": "no access", "description": "No environment access."}),
(
"database_admin",
{
"name": "Database Administrator",
"description": "Configures cloud-based database services.",
},
),
(
"devops",
{
"name": "DevOps",
"description": "Provisions, deprovisions, and deploys cloud-based IaaS and PaaS computing, networking, and storage services, including pre-configured machine images.",
},
),
(
"billing_admin",
{
"name": "Billing Administrator",
"description": "Views cloud resource usage, budget reports, and invoices; Tracks budgets, including spend reports, cost planning and projections, and sets limits based on cloud service usage.",
},
),
(
"security_admin",
{
"name": "Security Administrator",
"description": "Accesses information security and control tools of cloud resources which include viewing cloud resource usage logging, user roles and permissioning history.",
},
),
(
"financial_auditor",
{
"name": "Financial Auditor",
"description": "Views cloud resource usage and budget reports.",
},
),
]
FUNDING_TYPES = [
("", "- Select -"),
("RDTE", "Research, Development, Testing & Evaluation (RDT&E)"),

View File

@ -45,10 +45,10 @@ export default {
return this.choices[arr][1].name
}
}
return this.value
return this.value ? this.value : "no access"
},
label_class: function () {
return this.value === "no_access" ?
return this.displayName === "no access" ?
"label" : "label label--success"
}
}

View File

@ -64,7 +64,7 @@
<ul v-show='isVisible'>
{% for env in project.environments %}
{% set role = EnvironmentRole.get(member.user_id, env.id).role or 'no_access' %}
{% set role = EnvironmentRole.get(member.user_id, env.id).role %}
<li class='block-list__item'>
<edit-workspace-member inline-template initial-data='{{ role }}' v-bind:choices='{{ form.environment_role.choices | tojson }}'>