- /**
- * The node authenticated component (typically a CMS view) related to this
- * display, or null if none is available from this call.
- */
- public static NodeAuthenticated getNodeAuthenticated() {
- return UiContext.getData(NodeAuthenticated.KEY);
+ /** Returns true if the current user is in the specified role */
+ public static boolean isInRole(String role) {
+ Set<String> roles = roles();
+ return roles.contains(role);
+ }
+
+ /** Executes as the current user */
+ public final static <T> T doAs(PrivilegedAction<T> action) {
+ return Subject.doAs(currentSubject(), action);