mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-08 03:53:57 +00:00
Add partial role support for manager only using web-vault v2024.12.0 (#5219)
* Add partial role support for manager only - Add the custom role which replaces the manager role - Added mini-details endpoint used by v2024.11.1 These changes try to add the custom role in such a way that it stays compatible with the older manager role. It will convert a manager role into a custom role, and if a manager has `access-all` rights, it will enable the correct custom roles. Upon saving it will convert these back to the old format. What this does is making sure you are able to revert back to an older version of Vaultwarden without issues. This way we can support newer web-vault's and still be compatible with a previous Vaultwarden version if needed. In the future this needs to be changed to full role support though. Fixed the 2FA hide CSS since the order of options has changed Signed-off-by: BlackDex <black.dex@gmail.com> * Fix hide passkey login Signed-off-by: BlackDex <black.dex@gmail.com> * Fix hide create account Signed-off-by: BlackDex <black.dex@gmail.com> * Small changes for v2024.12.0 Signed-off-by: BlackDex <black.dex@gmail.com> * Fix hide create account link Signed-off-by: BlackDex <black.dex@gmail.com> * Add pre-release web-vault Signed-off-by: BlackDex <black.dex@gmail.com> * Rename function to mention swapping uuid's Signed-off-by: BlackDex <black.dex@gmail.com> --------- Signed-off-by: BlackDex <black.dex@gmail.com>
This commit is contained in:
parent
dfd9e65396
commit
4816f77fd7
10 changed files with 330 additions and 120 deletions
|
@ -42,12 +42,6 @@ label[for^="ownedBusiness"] {
|
|||
@extend %vw-hide;
|
||||
}
|
||||
|
||||
/* Hide the radio button and label for the `Custom` org user type */
|
||||
#userTypeCustom,
|
||||
label[for^="userTypeCustom"] {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
|
||||
/* Hide Business Name */
|
||||
app-org-account form div bit-form-field.tw-block:nth-child(3) {
|
||||
@extend %vw-hide;
|
||||
|
@ -58,42 +52,77 @@ app-organization-plans > form > bit-section:nth-child(2) {
|
|||
@extend %vw-hide;
|
||||
}
|
||||
|
||||
/* Hide Collection Management Form */
|
||||
app-org-account form.ng-untouched:nth-child(6) {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
|
||||
/* Hide 'Member Access' Report Card from Org Reports */
|
||||
app-org-reports-home > app-report-list > div.tw-inline-grid > div:nth-child(6) {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
|
||||
/* Hide Device Verification form at the Two Step Login screen */
|
||||
app-security > app-two-factor-setup > form {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
|
||||
/* Hide unsupported Custom Role options */
|
||||
bit-dialog div.tw-ml-4:has(bit-form-control input),
|
||||
bit-dialog div.tw-col-span-4:has(input[formcontrolname*="access"], input[formcontrolname*="manage"]) {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
|
||||
/* Hide Log in with passkey */
|
||||
app-login div.tw-flex:nth-child(4) {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
|
||||
/* Change collapsed menu icon to Vaultwarden */
|
||||
bit-nav-logo bit-nav-item a:before {
|
||||
content: "";
|
||||
background-image: url("../images/icon-white.svg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
height: 32px;
|
||||
display: block;
|
||||
}
|
||||
bit-nav-logo bit-nav-item .bwi-shield {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
/**** END Static Vaultwarden Changes ****/
|
||||
/**** START Dynamic Vaultwarden Changes ****/
|
||||
{{#if signup_disabled}}
|
||||
/* Hide the register link on the login screen */
|
||||
app-frontend-layout > app-login > form > div > div > div > p {
|
||||
app-login form div + div + div + div + hr,
|
||||
app-login form div + div + div + div + hr + p {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
{{/if}}
|
||||
|
||||
/* Hide `Email` 2FA if mail is not enabled */
|
||||
{{#unless mail_enabled}}
|
||||
app-two-factor-setup ul.list-group.list-group-2fa li.list-group-item:nth-child(5) {
|
||||
/* Hide `Email` 2FA if mail is not enabled */
|
||||
app-two-factor-setup ul.list-group.list-group-2fa li.list-group-item:nth-child(1) {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
{{/unless}}
|
||||
|
||||
/* Hide `YubiKey OTP security key` 2FA if it is not enabled */
|
||||
{{#unless yubico_enabled}}
|
||||
app-two-factor-setup ul.list-group.list-group-2fa li.list-group-item:nth-child(2) {
|
||||
/* Hide `YubiKey OTP security key` 2FA if it is not enabled */
|
||||
app-two-factor-setup ul.list-group.list-group-2fa li.list-group-item:nth-child(4) {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
{{/unless}}
|
||||
|
||||
/* Hide Emergency Access if not allowed */
|
||||
{{#unless emergency_access_allowed}}
|
||||
/* Hide Emergency Access if not allowed */
|
||||
bit-nav-item[route="settings/emergency-access"] {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
{{/unless}}
|
||||
|
||||
/* Hide Sends if not allowed */
|
||||
{{#unless sends_allowed}}
|
||||
/* Hide Sends if not allowed */
|
||||
bit-nav-item[route="sends"] {
|
||||
@extend %vw-hide;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue