Seeming working (though not very thoroughly tested) granular access control for reports, report templates and namespaces.
Should work both in local auth case and LDAP auth case.
This commit is contained in:
parent
89256d62bd
commit
34823cf0cf
17 changed files with 352 additions and 146 deletions
|
@ -66,8 +66,10 @@ export default class CUD extends Component {
|
|||
axios.get('/rest/namespaces-tree')
|
||||
.then(response => {
|
||||
|
||||
response.data.expanded = true;
|
||||
const data = [response.data];
|
||||
const data = response.data;
|
||||
for (const root of data) {
|
||||
root.expanded = true;
|
||||
}
|
||||
|
||||
if (this.props.edit && !this.isEditGlobal()) {
|
||||
this.removeNsIdSubtree(data);
|
||||
|
|
|
@ -16,16 +16,25 @@ export default class List extends Component {
|
|||
render() {
|
||||
const t = this.props.t;
|
||||
|
||||
const actions = key => [
|
||||
{
|
||||
label: 'Edit',
|
||||
link: '/namespaces/edit/' + key
|
||||
},
|
||||
{
|
||||
label: 'Share',
|
||||
link: '/namespaces/share/' + key
|
||||
const actions = node => {
|
||||
const actions = [];
|
||||
|
||||
if (node.data.permissions.includes('edit')) {
|
||||
actions.push({
|
||||
label: 'Edit',
|
||||
link: '/namespaces/edit/' + node.key
|
||||
});
|
||||
}
|
||||
];
|
||||
|
||||
if (node.data.permissions.includes('share')) {
|
||||
actions.push({
|
||||
label: 'Share',
|
||||
link: '/namespaces/share/' + node.key
|
||||
});
|
||||
}
|
||||
|
||||
return actions;
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
@ -35,7 +44,7 @@ export default class List extends Component {
|
|||
|
||||
<Title>{t('Namespaces')}</Title>
|
||||
|
||||
<TreeTable withHeader dataUrl="/rest/namespaces-tree" actions={actions} />
|
||||
<TreeTable withHeader withDescription dataUrl="/rest/namespaces-tree" actions={actions} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue