You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Torgeir Veimo <to...@pobox.com> on 2006/03/22 14:43:09 UTC

SystemSession

Is it possible to obtain an instance of a SystemSession in any way?

-- 
Torgeir Veimo <to...@pobox.com>


Re: SystemSession

Posted by Torgeir Veimo <to...@pobox.com>.
On Wed, 2006-03-22 at 15:23 +0100, Stefan Guggisberg wrote:
> On 3/22/06, Torgeir Veimo <to...@pobox.com> wrote:
> > On Wed, 2006-03-22 at 14:50 +0100, Stefan Guggisberg wrote:
> > > On 3/22/06, Torgeir Veimo <to...@pobox.com> wrote:
> > > > Is it possible to obtain an instance of a SystemSession in any way?
> > >
> > > no, SystemSessions is for jackrabbit-internal use only.
> > > however, you can easily create a omni-potent session by
> > > using a custom LoginModule/AccessManager implementation.
> >
> > How do I get a reference to a repository in either of those to do a
> > special "system" login? The repository config file and home directory is
> > confiugred in the deployment descriptor, so unaccessible in my code. The
> > AMContext holds a reference to the jackrabbit home directory, but not
> > the configuration file reference, thus I cannot instantiate a
> > TransientRepository.
> 
> what i meant is:
> - provide a custom LoginModule implementation that associates
>   'special' system credentials with a special 'System' subject.
> - provide a custom AccessManager implementation that knows
>   of the specials 'System' Subject and assigns access rights accordingly.
> - modify your jackrabbit configuration to use your custom LoginModule
>   and AccessManager
> - connect to your newly configured repository and pass your special
>   system credentials (whatever those might be)

Ok, I'll try that approach. 

There's no way to get a TransientRepository instance from repository
configuration specified in the deployment descriptor? Would be kind of
handy if I could construct one taking an existing repository as
argument.

-- 
Torgeir Veimo <to...@pobox.com>


Re: SystemSession

Posted by Stefan Guggisberg <st...@gmail.com>.
On 3/22/06, Torgeir Veimo <to...@pobox.com> wrote:
> On Wed, 2006-03-22 at 14:50 +0100, Stefan Guggisberg wrote:
> > On 3/22/06, Torgeir Veimo <to...@pobox.com> wrote:
> > > Is it possible to obtain an instance of a SystemSession in any way?
> >
> > no, SystemSessions is for jackrabbit-internal use only.
> > however, you can easily create a omni-potent session by
> > using a custom LoginModule/AccessManager implementation.
>
> How do I get a reference to a repository in either of those to do a
> special "system" login? The repository config file and home directory is
> confiugred in the deployment descriptor, so unaccessible in my code. The
> AMContext holds a reference to the jackrabbit home directory, but not
> the configuration file reference, thus I cannot instantiate a
> TransientRepository.

what i meant is:
- provide a custom LoginModule implementation that associates
  'special' system credentials with a special 'System' subject.
- provide a custom AccessManager implementation that knows
  of the specials 'System' Subject and assigns access rights accordingly.
- modify your jackrabbit configuration to use your custom LoginModule
  and AccessManager
- connect to your newly configured repository and pass your special
  system credentials (whatever those might be)

cheers
stefan


>
> --
> Torgeir Veimo <to...@pobox.com>
>
>

Re: SystemSession

Posted by Torgeir Veimo <to...@pobox.com>.
On Wed, 2006-03-22 at 14:50 +0100, Stefan Guggisberg wrote:
> On 3/22/06, Torgeir Veimo <to...@pobox.com> wrote:
> > Is it possible to obtain an instance of a SystemSession in any way?
> 
> no, SystemSessions is for jackrabbit-internal use only.
> however, you can easily create a omni-potent session by
> using a custom LoginModule/AccessManager implementation.

How do I get a reference to a repository in either of those to do a
special "system" login? The repository config file and home directory is
confiugred in the deployment descriptor, so unaccessible in my code. The
AMContext holds a reference to the jackrabbit home directory, but not
the configuration file reference, thus I cannot instantiate a
TransientRepository.

-- 
Torgeir Veimo <to...@pobox.com>


Re: SystemSession

Posted by Stefan Guggisberg <st...@gmail.com>.
On 3/22/06, Torgeir Veimo <to...@pobox.com> wrote:
> Is it possible to obtain an instance of a SystemSession in any way?

no, SystemSessions is for jackrabbit-internal use only.
however, you can easily create a omni-potent session by
using a custom LoginModule/AccessManager implementation.

cheers
stefan

>
> --
> Torgeir Veimo <to...@pobox.com>
>
>