Skip to content

IProtectedTags

Interface in Oadm.Sdk.Devices · Oadm.Sdk.dll

Tag names a core plugin protects (SDK 0.4.0, ICorePluginContext.ProtectedTags): only users with all devices may add them to or remove them from devices, like the tags a device group uses (docs/spec/tags.md). For a plugin whose settings act on devices by tag, e.g. the VLAN rules of the 802.1X server: a user limited to a device group tags the devices of the group but never gives one of them a protected tag. Rename and delete of a tag need all devices anyway.

public interface IProtectedTags
void Protect(IReadOnlyCollection<string> names, Func<string, string> refusal)

Sets this plugin’s protected names (case-insensitive; replaces the earlier set, empty protects nothing) and the refusal a user limited to a device group gets for one of them (refusal gets the tag’s name; one plain sentence plus “Nothing was changed.”). The host checks them inside the tag write, so keep refusal cheap. The host keeps the set while the plugin is installed, also while it is stopped or turned off and over a server restart (with the texts refusal gave), until the plugin sets a new one; it forgets the set when the plugin is removed.

void Protect(IReadOnlyCollection<string> names, Func<string, string> refusal, Func<string, string> changeRefusal)

Default implementation

IProtectedTags.Protect plus the refusal of a rename or delete of one of the tags (SDK 0.4.0). While the plugin runs, the host refuses both for every user, administrators too, because the plugin’s settings name the tag (“The tag Floor 3 sets a VLAN. Change the VLAN rule first. Nothing was changed.”); without this text the host uses its own. While the plugin is stopped or off the tag can be renamed or deleted (the settings match it by name, so it then matches nothing). An older host ignores changeRefusal.