mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-11-15 01:55:58 +02:00
Add Custom Roles group and policy permissions (#7962)
This commit is contained in:
5 files changed
+217
-76
No files matched your search
+11
@@ -887,6 +887,7 @@ impl<'r> FromRequest<'r> for AdminHeaders {
|
||||
macro_rules! permission_headers {
|
||||
($(#[$doc:meta])* $name:ident, $permission:expr) => {
|
||||
$(#[$doc])*
|
||||
#[allow(dead_code, reason = "Not every route reads every field")]
|
||||
pub struct $name {
|
||||
pub device: Device,
|
||||
pub user: User,
|
||||
@@ -926,6 +927,16 @@ permission_headers!(
|
||||
ManageUsersHeaders,
|
||||
CustomPermission::ManageUsers
|
||||
);
|
||||
permission_headers!(
|
||||
/// For the routes that manage the policies of an organization.
|
||||
ManagePoliciesHeaders,
|
||||
CustomPermission::ManagePolicies
|
||||
);
|
||||
permission_headers!(
|
||||
/// For the routes that manage the groups of an organization.
|
||||
ManageGroupsHeaders,
|
||||
CustomPermission::ManageGroups
|
||||
);
|
||||
|
||||
// col_id is usually the fourth path param ("/organizations/<org_id>/collections/<col_id>"),
|
||||
// but there could be cases where it is a query value.
|
||||
|
||||
Reference in new issue
Block a user