jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: SPI: repositoryService.isGranted()
Date Tue, 20 Feb 2007 09:15:36 GMT
Hi Julian,

I agree, the method should be changed to take an absolute path. or was there a 
reason why we used ItemId there?


Julian Reschke wrote:
> Hi,
> I was recently refactoring my permission check support and came across 
> the following issue:
>     public boolean isGranted(SessionInfo sessionInfo, ItemId itemId, 
> String[] actions) throws RepositoryException;
> The problem here is that in some cases (such as in add_node and 
> set_property), the ItemId may refer to an item that doesn't exist (yet), 
> so it's impossible for the transient layer to decide whether to produce 
> a NodeId or an ItemId.
> Now in some case (such as when actions is {"add_node"}), the transient 
> layer could make an assumption about the type of the id based on the 
> action to be checked. However, this will get ugly when several actions 
> are checked in a single method call.
> Thus, wouldn't it make sense to change the method signature to
>     public boolean isGranted(SessionInfo sessionInfo, Path absPath, 
> String[] actions) throws RepositoryException;
> instead?

View raw message