Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add access control for portfolio metrics #741

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@
"base_url": "Base URL",
"enable_svg_badge": "Enable SVG badge support (unauthenticated)",
"enable_acl": "Enable portfolio access control (beta)",
"enable_acl_portfolio_metrics": "Enable use of access control for portfolio metrics",
"enable_bom_cyclonedx": "Enable CycloneDX",
"enable_bom_spdx": "Enable SPDX",
"enable_email": "Enable email",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
<template>
<b-card no-body :header="header">
<b-card-body>
<div id="customToolbar">
<c-switch
id="isAclEnabled"
color="primary"
v-model="isAclEnabled"
label
v-bind="labelIcon"
/>{{ $t('admin.enable_acl') }}
</div>
<c-switch
id="isAclEnabled"
color="primary"
v-model="isAclEnabled"
label v-bind="labelIcon"
/>{{$t('admin.enable_acl')}}
<br/>
<c-switch
id="isAclPortfolioMetricsEnabled"
color="primary"
v-model="isAclPortfolioMetricsEnabled"
label
v-bind="labelIcon"
/>{{$t('admin.enable_acl_portfolio_metrics')}}
<bootstrap-table
ref="table"
:columns="columns"
Expand Down Expand Up @@ -46,6 +51,7 @@ export default {
data() {
return {
isAclEnabled: false,
isAclPortfolioMetricsEnabled: false,
labelIcon: {
dataOn: '\u2713',
dataOff: '\u2715',
Expand Down Expand Up @@ -222,6 +228,11 @@ export default {
propertyName: 'acl.enabled',
propertyValue: this.isAclEnabled,
},
{
groupName: 'access-management',
propertyName: 'acl.portfoliometrics.enabled',
propertyValue: this.isAclPortfolioMetricsEnabled,
},
]);
},
updateConfigProperties: function (configProperties) {
Expand All @@ -246,6 +257,9 @@ export default {
isAclEnabled() {
this.updateProperties();
},
isAclPortfolioMetricsEnabled() {
this.updateProperties();
},
},
created() {
this.axios.get(this.configUrl).then((response) => {
Expand All @@ -258,6 +272,9 @@ export default {
case 'acl.enabled':
this.isAclEnabled = common.toBoolean(item.propertyValue);
break;
case 'acl.portfoliometrics.enabled':
this.isAclPortfolioMetricsEnabled = common.toBoolean(item.propertyValue);
break;
}
}
});
Expand Down