There is a bit of a description on one of the comments on the issue:

"So I opted for a lower tech solution and that is just to maintain the
order of the rules when read from the underlying property file. Therefore
any exceptions can go at the top of the file and the catch all rules like
"/**" can go at the bottom to achieve the desired goal."

Basically the idea is to not use Properies.load to read the file which
throws away ordering. Instead we read the file line by line and place the
entries in a map (using a LinkedHashMap) to maintain ordering. For the
other security access daos ordering doesn't really matter since the rules
are parsed into a tree, but for the rest rules we don't do the same
(because its pattern based) so we ensure to maintain the ordering of the
entires in the incoming map. I guess maybe we should make the loadRules()
method for dao subclasses explicit by passing it a LinkedHashMap.

On Thu, May 31, 2012 at 8:50 AM, Andrea Aime
<[email protected]>wrote:

> On Thu, May 31, 2012 at 4:44 PM, Justin Deoliveira <[email protected]>
> wrote:
> > There is actually already an existing patch that does I think something
> > similar to what is being suggested here:
> >
> >   http://jira.codehaus.org/browse/GEOS-3791
> >
> > Its been sitting there for a while. I am thinking with the security
> changes
> > in 2.2 it would be a good time to push this in.
>
> Just had a quick look, I see the usage of the LinkedHashMap, but I also
> see a number of TreeMap still in the mix... maybe a bit of explanation of
> how the patch works would not hurt
>
> Cheers
> Andrea
>
> --
> Ing. Andrea Aime
> GeoSolutions S.A.S.
> Tech lead
>
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
>
> phone: +39 0584 962313
> fax:      +39 0584 962313
> mob:    +39 339 8844549
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.youtube.com/user/GeoSolutionsIT
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>



-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to