jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Reschke <julian.resc...@gmx.de>
Subject SPI: repositoryService.isGranted()
Date Mon, 19 Feb 2007 16:09:58 GMT
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?

Best regards, Julian


Mime
View raw message