You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Shane Preater <sh...@googlemail.com> on 2006/09/01 16:11:14 UTC

Getting the path from a NodeId

Hi,
I am tasked with adding Jaas support to my clients Jack rabbit repository so
that they can define who can read, write and remove nodes in a repository
depending on Principals.

They need to be able to set the permissions for nodes based on an XPath
string which can then be resolved against the actual path of the node
requested.

In the AccessManager there is a function called checkPermission(ItemId, int)
which looks like the right place to add this but in order for it to work I
need to resolve the nodes path from the NodeId. Is this even possible?

Many thanks,
Shane.

Re: Getting the path from a NodeId

Posted by Shane Preater <sh...@googlemail.com>.
Ahh its even easier.
Because I am in the AccessManager I do not know about the workspace but.
I am supplied with a HierarchyManager which gives me a function called
getPath and takes an ItemId.
So sorted.

Thanks for your help though. I just hope this helps some others who are
trying to setup more comprehensive authorization than the default.

Shane.

On 01/09/06, Nicolas <nt...@gmail.com> wrote:
>
> Hi,
>
> This has been discussed already. If you know the workspace of the NodeId
> then you can use session.getNodeById.
>
> Cheers
> Nico
> my blog! http://www.deviant-abstraction.net !!
> On 9/1/06, Shane Preater <sh...@googlemail.com> wrote:
> >
> > Hi,
> > I am tasked with adding Jaas support to my clients Jack rabbit
> repository
> > so
> > that they can define who can read, write and remove nodes in a
> repository
> > depending on Principals.
> >
> > They need to be able to set the permissions for nodes based on an XPath
> > string which can then be resolved against the actual path of the node
> > requested.
> >
> > In the AccessManager there is a function called checkPermission(ItemId,
> > int)
> > which looks like the right place to add this but in order for it to work
> I
> > need to resolve the nodes path from the NodeId. Is this even possible?
> >
> > Many thanks,
> > Shane.
> >
> >
>
>

Re: Getting the path from a NodeId

Posted by Nicolas <nt...@gmail.com>.
Hi,

This has been discussed already. If you know the workspace of the NodeId
then you can use session.getNodeById.

Cheers
Nico
my blog! http://www.deviant-abstraction.net !!
On 9/1/06, Shane Preater <sh...@googlemail.com> wrote:
>
> Hi,
> I am tasked with adding Jaas support to my clients Jack rabbit repository
> so
> that they can define who can read, write and remove nodes in a repository
> depending on Principals.
>
> They need to be able to set the permissions for nodes based on an XPath
> string which can then be resolved against the actual path of the node
> requested.
>
> In the AccessManager there is a function called checkPermission(ItemId,
> int)
> which looks like the right place to add this but in order for it to work I
> need to resolve the nodes path from the NodeId. Is this even possible?
>
> Many thanks,
> Shane.
>
>