Hi Dan,

It's not my operation...

I'm trying to autogenerate content into a template-area using the 
autoGeneration configuration (and my own generator, rather than the 
CopyGenerator).
The doInSystemContext() operation is invoked by the AreaElement - not under my 
control.

I need the logged in user as the content I am trying to generate is the 
information about the author (=current user), specifically the user's 
department.

:-(

How can this be solved?
--> Idea #1: either need to replace/patch AreaElement    :-(    :-(     :-(
--> Idea #2: add a feature to WebContext for the "loginUser" --> this property 
could remain unchanged even in doInSystemContext operations
--> Idea #3: add the feature "getOriginalContext" or "getOriginalUser" to the 
Op Interface in MgnlContext

Unfortunately, I don't think I can do any of these things by extension alone, 
meaning I need changes in magnolia's core code. I'll think on it a little more, 
and then file a support request.

Regards from Vienna,

Richard



> -----Ursprüngliche Nachricht-----
> Von: [email protected] [mailto:user-list-owner@magnolia-
> cms.com] Im Auftrag von Daniel Lipp (via Magnolia Forums)
> Gesendet: Mittwoch, 29. Jänner 2014 07:35
> An: Magnolia User List
> Betreff: [magnolia-user] Re: Accessing current User in System context
> 
> Hi Richard,
> 
> nope - there isn't. What you can do of course is adding a field (e.g.
> 'originalUser') to your Operation and populate it from outside the
> doInSystemContext().
> 
> The only example I'm aware of is ChangeLastUpdateDateOp
> (https://git.magnolia-
> cms.com/gitweb/?p=magnolia_main.git;a=blob;f=magnolia-
> core/src/main/java/info/magnolia/jcr/wrapper/MgnlPropertySettingConten
> tDecorator.java;h=5e76d71e4f1d34611f731827d0664f4d006483e1;hb=HEAD)
> 
> Cheers
> Dan
> 
> --
> Context is everything: http://forum.magnolia-
> cms.com/forum/thread.html?threadId=9d66f7d4-41ca-4ad9-8ea0-
> 166f48ab63fa
> 
> 
> ----------------------------------------------------------------
> For list details, see http://www.magnolia-cms.com/community/mailing-
> lists.html
> Alternatively, use our forums: http://forum.magnolia-cms.com/
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------



----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to