Skip to content

Commit

Permalink
Add access control for portfolio metrics
Browse files Browse the repository at this point in the history
Signed-off-by: mulder999 <nospam099-github@yahoo.com>
  • Loading branch information
mulder999 committed Feb 18, 2024
1 parent 538e77e commit 99d13a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,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,9 +1,9 @@
<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 @@ -38,6 +38,7 @@ export default {
data() {
return {
isAclEnabled: false,
isAclPortfolioMetricsEnabled: false,
labelIcon: {
dataOn: '\u2713',
dataOff: '\u2715'
Expand Down Expand Up @@ -189,7 +190,8 @@ export default {
},
updateProperties: function() {
this.updateConfigProperties([
{groupName: 'access-management', propertyName: 'acl.enabled', propertyValue: this.isAclEnabled}
{groupName: 'access-management', propertyName: 'acl.enabled', propertyValue: this.isAclEnabled},
{groupName: 'access-management', propertyName: 'acl.portfoliometrics.enabled', propertyValue: this.isAclPortfolioMetricsEnabled}
]);
},
updateConfigProperties: function(configProperties) {
Expand All @@ -210,6 +212,9 @@ export default {
watch:{
isAclEnabled() {
this.updateProperties();
},
isAclPortfolioMetricsEnabled() {
this.updateProperties();
}
},
created() {
Expand All @@ -220,6 +225,8 @@ export default {
switch (item.propertyName) {
case "acl.enabled":
this.isAclEnabled = common.toBoolean(item.propertyValue); break;
case "acl.portfoliometrics.enabled":
this.isAclPortfolioMetricsEnabled = common.toBoolean(item.propertyValue); break;
}
}
});
Expand Down

0 comments on commit 99d13a9

Please sign in to comment.