[pve-devel] [PATCH access-control 2/2] PVE/RPCEnvironment: add helper for checking hw permissions
Dominik Csapak
d.csapak at proxmox.com
Mon Jun 21 15:55:19 CEST 2021
like check_vm_perm, etc.
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
src/PVE/RPCEnvironment.pm | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/PVE/RPCEnvironment.pm b/src/PVE/RPCEnvironment.pm
index 2e5a33b..1fac627 100644
--- a/src/PVE/RPCEnvironment.pm
+++ b/src/PVE/RPCEnvironment.pm
@@ -250,6 +250,14 @@ sub check_vm_perm {
return $self->check_full($user, "/vms/$vmid", $privs, $any, $noerr);
};
+sub check_hw_perm {
+ my ($self, $user, $id, $privs, $any, $noerr) = @_;
+
+ my $cfg = $self->{user_cfg};
+
+ return $self->check_full($user, "/hardware/$id", $privs, $any, $noerr);
+}
+
sub is_group_member {
my ($self, $group, $user) = @_;
--
2.20.1
More information about the pve-devel
mailing list