portctl_nameonly to limit port control to name only (F. Schiavarelli)

This commit is contained in:
Oliver Gorwits
2014-07-13 17:51:41 +01:00
parent 769aa35044
commit 3457d083f4
4 changed files with 21 additions and 0 deletions

View File

@@ -1,5 +1,9 @@
2.028001 2.028001
[ENHANCEMENTS]
* portctl_nameonly to limit port control to name only (F. Schiavarelli)
[BUG FIXES] [BUG FIXES]
* [ND1#117] unknown devices missing from inventory * [ND1#117] unknown devices missing from inventory

View File

@@ -782,6 +782,14 @@ field to use as the management IP address for a device.
Value: Boolean. Default: C<true>. Value: Boolean. Default: C<true>.
Set to false to prevent users from changing the default VLAN on an interface. Set to false to prevent users from changing the default VLAN on an interface.
This setting has no effect when C<portctl_nameonly> below is set to true.
=head3 C<portctl_nameonly>
Value: Boolean. Default: C<false>.
Set to true to limit port control action to only changing the interface name
(description).
=head3 C<portctl_nophones> =head3 C<portctl_nophones>

View File

@@ -68,6 +68,10 @@ sub vlan_reconfig_check {
=item * =item *
Permission check that C<portctl_nameonly> is false in Netdisco config.
=item *
Permission check that C<portctl_uplinks> is true in Netdisco config, if Permission check that C<portctl_uplinks> is true in Netdisco config, if
C<$port> is an uplink. C<$port> is an uplink.
@@ -95,6 +99,10 @@ sub port_reconfig_check {
my $has_phone = port_has_phone($port); my $has_phone = port_has_phone($port);
my $is_vlan = is_vlan_interface($port); my $is_vlan = is_vlan_interface($port);
# only permitted to change interface name
return "forbidden: not permitted to change port configuration"
if setting('portctl_nameonly');
# uplink check # uplink check
return "forbidden: port [$name] on [$ip] is an uplink" return "forbidden: port [$name] on [$ip] is an uplink"
if $port->remote_type and not $has_phone and not setting('portctl_uplinks'); if $port->remote_type and not $has_phone and not setting('portctl_uplinks');

View File

@@ -144,6 +144,7 @@ ignore_interfaces:
ignore_private_nets: false ignore_private_nets: false
reverse_sysname: false reverse_sysname: false
vlanctl: true vlanctl: true
portctl_nameonly: false
portctl_nophones: false portctl_nophones: false
portctl_vlans: false portctl_vlans: false
portctl_uplinks: false portctl_uplinks: false