com.waveset.object
Class WSUserUtil

java.lang.Object
  extended bycom.waveset.object.WSUserUtil

public final class WSUserUtil
extends java.lang.Object

A bag of WSUser helper methods


Field Summary
static java.lang.String code_id
           
protected static Trace trace
           
 
Constructor Summary
WSUserUtil()
           
 
Method Summary
static java.lang.Object callInternalRule(java.lang.String name, java.util.Map args, ObjectCache cache)
           
static java.util.List getAllAdminGroups(Principal p, LighthouseContext context, java.util.Map options)
          This method will return a list of ObjectRefs to the AdminGroups assigned directly (via _memberAdminGroups) and indirectly (via _adminRoles) for the specified principal.
static java.util.List getAllControlledObjectGroups(WSUser user, LighthouseContext context, java.util.Map options)
          This method will return a list of ObjectRefs to the ObjectGroups controlled directly (via _controlledObjectGroups) and indirectly (via _adminRoles) for the specified user.
static java.util.Locale getExplicitLocale(Principal user)
          Retrieves the Locale for the user from the Principal.LOCALE_PROP property.
static java.util.Locale getLastLoginLocale(Principal user)
          Retrieves the Locale for the user from the Principal.LAST_LOGIN_LOCALE_PROP property.
static java.util.List getRuleDrivenObjectRefs(ObjectRef ruleRef, Type type, java.lang.String userName, LighthouseContext context)
           
static GenericObject getUserViewArgs(LighthouseContext context, java.lang.String userName)
           
static void setExplicitLocale(Principal user, java.util.Locale locale)
          Sets the Locale for the user as a String in the Principal.LOCALE_PROP property.
static void setLastLoginLocale(Principal user, java.util.Locale locale)
          Sets the Locale for the user as a String in the Principal.LAST_LOGIN_LOCALE_PROP property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

trace

protected static Trace trace
Constructor Detail

WSUserUtil

public WSUserUtil()
Method Detail

getAllAdminGroups

public static java.util.List getAllAdminGroups(Principal p,
                                               LighthouseContext context,
                                               java.util.Map options)
                                        throws WavesetException
This method will return a list of ObjectRefs to the AdminGroups assigned directly (via _memberAdminGroups) and indirectly (via _adminRoles) for the specified principal. It's assumed that the Lighthouse context passed in is not a session context and therefore has access to all objects in the server cache / repo. Supported options include: - "subjectUser" - if the pricipal passed in is not an instanceof WSUser then the subjectUser's name must be passed in if there's an admin group rule assigned to enable getting the subjectUser's user view to pass as rule args. - "flatten" ("true" or "false") - if true will return a flattened list of assigned admin group refs including refs to nested admin groups

Throws:
WavesetException

getAllControlledObjectGroups

public static java.util.List getAllControlledObjectGroups(WSUser user,
                                                          LighthouseContext context,
                                                          java.util.Map options)
                                                   throws WavesetException
This method will return a list of ObjectRefs to the ObjectGroups controlled directly (via _controlledObjectGroups) and indirectly (via _adminRoles) for the specified user. It's assumed that the Lighthouse context passed in is not a session context and therefore has access to all objects in the server cache / repo. Supported options include: - "flatten" ("true" or "false") - if true will return a flattened list of controlled object group refs including refs to nested object groups

Throws:
WavesetException

getRuleDrivenObjectRefs

public static java.util.List getRuleDrivenObjectRefs(ObjectRef ruleRef,
                                                     Type type,
                                                     java.lang.String userName,
                                                     LighthouseContext context)
                                              throws WavesetException
Throws:
WavesetException

getUserViewArgs

public static GenericObject getUserViewArgs(LighthouseContext context,
                                            java.lang.String userName)
                                     throws WavesetException
Throws:
WavesetException

callInternalRule

public static java.lang.Object callInternalRule(java.lang.String name,
                                                java.util.Map args,
                                                ObjectCache cache)
                                         throws WavesetException
Throws:
WavesetException

setExplicitLocale

public static void setExplicitLocale(Principal user,
                                     java.util.Locale locale)
Sets the Locale for the user as a String in the Principal.LOCALE_PROP property.


setLastLoginLocale

public static void setLastLoginLocale(Principal user,
                                      java.util.Locale locale)
Sets the Locale for the user as a String in the Principal.LAST_LOGIN_LOCALE_PROP property.


getExplicitLocale

public static java.util.Locale getExplicitLocale(Principal user)
Retrieves the Locale for the user from the Principal.LOCALE_PROP property.


getLastLoginLocale

public static java.util.Locale getLastLoginLocale(Principal user)
Retrieves the Locale for the user from the Principal.LAST_LOGIN_LOCALE_PROP property.