mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-08-14 13:04:21 +00:00
check_sdn_bridge: check bridge first
it's cheap, so let's use it for early returning Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
3c97bee53c
commit
e1ea58c810
@ -329,6 +329,9 @@ sub check_sdn_bridge {
|
|||||||
my ($self, $username, $zone, $bridge, $privs, $noerr) = @_;
|
my ($self, $username, $zone, $bridge, $privs, $noerr) = @_;
|
||||||
|
|
||||||
my $path = "/sdn/zones/$zone/$bridge";
|
my $path = "/sdn/zones/$zone/$bridge";
|
||||||
|
# check access to bridge itself
|
||||||
|
return 1 if $self->check_any($username, $path, $privs, 1);
|
||||||
|
|
||||||
my $cfg = $self->{user_cfg};
|
my $cfg = $self->{user_cfg};
|
||||||
my $bridge_acl = PVE::AccessControl::find_acl_tree_node($cfg->{acl_root}, $path);
|
my $bridge_acl = PVE::AccessControl::find_acl_tree_node($cfg->{acl_root}, $path);
|
||||||
if ($bridge_acl) {
|
if ($bridge_acl) {
|
||||||
@ -338,8 +341,6 @@ sub check_sdn_bridge {
|
|||||||
my $vlanpath = "$path/$vlan";
|
my $vlanpath = "$path/$vlan";
|
||||||
return 1 if $self->check_any($username, $vlanpath, $privs, 1);
|
return 1 if $self->check_any($username, $vlanpath, $privs, 1);
|
||||||
}
|
}
|
||||||
# check access to bridge itself
|
|
||||||
return 1 if $self->check_any($username, $path, $privs, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# repeat check, but fatal
|
# repeat check, but fatal
|
||||||
|
Loading…
Reference in New Issue
Block a user