You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by bu...@apache.org on 2014/02/07 16:13:07 UTC
svn commit: r896746 - in /websites/staging/isis/trunk: cgi-bin/ content/
content/applib-guide/reference/Security.html content/documentation.html
Author: buildbot
Date: Fri Feb 7 15:13:07 2014
New Revision: 896746
Log:
Staging update by buildbot for isis
Modified:
websites/staging/isis/trunk/cgi-bin/ (props changed)
websites/staging/isis/trunk/content/ (props changed)
websites/staging/isis/trunk/content/applib-guide/reference/Security.html
websites/staging/isis/trunk/content/documentation.html
Propchange: websites/staging/isis/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Feb 7 15:13:07 2014
@@ -1 +1 @@
-1565668
+1565673
Propchange: websites/staging/isis/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Feb 7 15:13:07 2014
@@ -1 +1 @@
-1565668
+1565673
Modified: websites/staging/isis/trunk/content/applib-guide/reference/Security.html
==============================================================================
--- websites/staging/isis/trunk/content/applib-guide/reference/Security.html (original)
+++ websites/staging/isis/trunk/content/applib-guide/reference/Security.html Fri Feb 7 15:13:07 2014
@@ -289,26 +289,36 @@ representation of their user and roles u
This allows the application to inspect and act upon those details if
required.</p>
+<p>These can be obtained from the <code>DomainObjectContainer</code>:</p>
+
+<pre><code>final UserMemento user = container.getUser();
+</code></pre>
+
<p>The user details are captured in the
<code>org.apache.isis.applib.security.UserMemento</code> class ("memento" because it
-is a snapshot of their credentials at the point of logging on). The
-<code>UserMemento</code> class defines the following properties:</p>
+is a snapshot of their credentials at the point of logging on). </p>
+
+<p>The roles of the user can be obtained in turn:</p>
+
+<pre><code>final List<RoleMemento> roles = user.getRoles();
+</code></pre>
+
+<p>Both <code>UserMemento</code> and <code>RoleMemento</code> are defined in Isis applib.</p>
+
+<h3><code>BackgroundService</code>s and `CommandContext</h3>
+
+<p>If using the <a href="../../core/services/background-service.html">BackgroundService</a>, then it is possible to persist commands that will execute corresponding actions in the background (for example under the control of a scheduler).</p>
+
+<p>In this situation, the <code>user</code> obtained from <code>DomainObjectContainer</code> will be that of the scheduler process, which may not be what you want.</p>
+
+<p>However, the creator of the background <code>Command</code> (the effective user, if you like), <em>can</em> be obtained from the <code>CommandContext</code> service, using:</p>
-<ul>
-<li><code>name</code> (a <code>String</code>)</li>
-<li>collection of roles (as <code>RoleMemento</code>)</li>
-</ul>
-
-<p>The <code>org.apache.isis.applib.security.RoleMemento</code> class in turn defines
-two properties:</p>
-
-<ul>
-<li><code>name</code> (a <code>String</code>)</li>
-<li><code>description</code> (a <code>String</code>)</li>
-</ul>
+<pre><code>final String userName = commandContext.getCommand().getUser()
+</code></pre>
-<p>To obtain the current user, the application can call
-<code>DomainObjectContainer#getUser()</code>. </p>
+<blockquote>
+ <p><em>Note</em>: At the time of writing, the roles of the effective user are not captured. </p>
+</blockquote>
Modified: websites/staging/isis/trunk/content/documentation.html
==============================================================================
--- websites/staging/isis/trunk/content/documentation.html (original)
+++ websites/staging/isis/trunk/content/documentation.html Fri Feb 7 15:13:07 2014
@@ -612,10 +612,14 @@
<h4>Reference</h4>
+<p></div>
+<div class="col-md-4"></p>
+
<ul>
<li><a href="./applib-guide/reference/Recognized-Methods-and-Prefixes.html">Recognized Methods and Prefixes</a></li>
<li><a href="./applib-guide/reference/recognized-annotations/about.html">Recognized Annotations</a></li>
-<li><a href="./applib-guide/how-tos/how-to-07-070-How-to-hook-into-the-object-lifecycle-using-callbacks.html">Lifecycle callbacks</a>
+<li><a href="./applib-guide/how-tos/how-to-07-070-How-to-hook-into-the-object-lifecycle-using-callbacks.html">Lifecycle callbacks</a></li>
+<li><a href="applib-guide/reference/Utility.html">Applib utility classes</a>
</div>
<div class="col-md-4"></li>
</ul>
@@ -625,9 +629,6 @@
<ul>
<li><a href="./applib-guide/reference/Security.html">Security</a></li>
<li><a href="./applib-guide/reference/Event.html">Applib Events</a></li>
-<li><a href="applib-guide/reference/Utility.html">Applib utility classes</a>
-</div>
-<div class="col-md-4"></li>
</ul>
<h4>Customisation</h4>