Skip to content

Commit

Permalink
fix peer creation for client interface (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
h44z committed Feb 26, 2025
1 parent dabdf11 commit 986f6fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/app/wireguard/wireguard_peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (m Manager) PreparePeer(ctx context.Context, id domain.InterfaceIdentifier)
return nil, fmt.Errorf("unable to find interface %s: %w", id, err)
}

if m.cfg.Core.SelfProvisioningAllowed && iface.Type != domain.InterfaceTypeServer {
if m.cfg.Core.SelfProvisioningAllowed && !currentUser.IsAdmin && iface.Type != domain.InterfaceTypeServer {
return nil, fmt.Errorf("self provisioning is only allowed for server interfaces: %w", domain.ErrNoPermission)
}

Expand Down

0 comments on commit 986f6fd

Please sign in to comment.