mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-19 13:41:10 +02:00
* Request resultant-acl only from users root namespace * Update permissions adapter to always call resultant-acl at users root, with test * Update resultant-acl to accept failType * Update permissions service to set permissionsBanner based on resultant-acl contents * wire it up * add changelog * cleanup unused adapter changes * use getter for shared namespace logic
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { service } from '@ember/service';
|
|
import Component from '@glimmer/component';
|
|
import { tracked } from '@glimmer/tracking';
|
|
import { PERMISSIONS_BANNER_STATES } from 'vault/services/permissions';
|
|
|
|
export default class ResultantAclBannerComponent extends Component {
|
|
@service namespace;
|
|
@service router;
|
|
@tracked hideBanner = false;
|
|
|
|
get ns() {
|
|
return this.namespace.path || 'root';
|
|
}
|
|
|
|
get queryParams() {
|
|
// Bring user back to current page after login
|
|
return { redirect_to: this.router.currentURL };
|
|
}
|
|
|
|
get title() {
|
|
return this.args.failType === PERMISSIONS_BANNER_STATES.noAccess
|
|
? 'You do not have access to this namespace'
|
|
: 'Resultant ACL check failed';
|
|
}
|
|
|
|
get message() {
|
|
return this.args.failType === PERMISSIONS_BANNER_STATES.noAccess
|
|
? 'Log into the namespace directly, or contact your administrator if you think you should have access.'
|
|
: "Links might be shown that you don't have access to. Contact your administrator to update your policy.";
|
|
}
|
|
}
|