GeoServer ACL - Rules ordering is not conserving when putting a list of rules with API

Hello,

I’m using the REST API to add ACL REST rules in to control the management of certain areas of the data directory to users / user groups based on roles.

For a given rule (eg to restrain CRUD resource management in a given workspace), I first add it with a POST request, but considering in the ACL the ordering of rules is important, I want to reorder the rules, and move workspace-related rules on top of the list so they appear first in the rest.properties, and match first. Rules are reordered and submitted to the API with a PUT request (for modification).

Although I pay attention to reorder the rules sent to the API with the PUT request, Geoserver doesn’t conserve this ordering. Is it normal? (considering the importance of the ordering in the rest.properties file). I’ve checked this AbstractAclController class: geoserver/src/restconfig/src/main/java/org/geoserver/rest/security/AbstractAclController.java at main · geoserver/geoserver · GitHub and in particular I see the putMap method doesn’t use a LinkedHashSet but a simple HashSet. Is it a bug?

Is there another way through the REST API to instruct it to have ACL REST rules in a certain order?

Thanks in advance

Best

Emmanuel

The version I’m using is 2.26.2 (still relatively recent). I’ve tried on the 3.0-RC on localhost and I can’t reproduce the issue. However I see there is a note in code that says “// TODO, will not work for REST”. Can it be that I get a different behavior locally on this endpoint?

Hi @eblondel

This Jira issue was fixed in v2.28.3 and 3.0-RC.

Peter

1 Like

Thanks a lot @Peter !