Skip to content

Acl: maintain ordering while inserting new rules

Abhishek Lekshmanan requested to merge wip-acl-ordering into master

This changeset implements ordering for adding acl rules and also adds a couple of flags to allow placing an acl rule at a given postiion, the position is indexed from 1 which is the first postion (or technically the beginning of the list or 0), 1-indexing was chosen over 0-indexing as the default operation is append the rule, and protobuf will default integer values to 0, so we want the default operation to be the least expensive. A flag --first is provided which essentially passes position as 1, moving a given rule to the first. Additionally if --position is passed to an existing rule, this will move the given rule to the said position, right now we keep this behaviour as default though this is controlled internally via a move_existing boolean which we pass as true. We could consider switching this behaviour off by default and enabling this via just another cli flag.

implements EOS-4746

Signed-off-by: Abhishek Lekshmanan abhishek.lekshmanan@cern.ch

Edited by Abhishek Lekshmanan

Merge request reports