pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.util.adminui
Class RightsCheckUtils

java.lang.Object
  extended by org.torweg.pulse.util.adminui.RightsCheckUtils

public final class RightsCheckUtils
extends java.lang.Object

provides various methods to perform user-checks.

this class is only temporary, until the general rights system has been refactored

Version:
$Revision: 1506 $
Author:
Daniel Dietz

Method Summary
static net.sf.json.JSONObject checkUserAgainstLocale(Bundle bundle, ServiceRequest request, java.util.Locale locale)
          checks the rights of a given user against a given locale according to the ".Edit.locales" the user has assigned for the given bundle.
static net.sf.json.JSONObject checkUserAgainstLocale(net.sf.json.JSONObject prevError, Bundle bundle, ServiceRequest request, java.util.Locale locale)
          checks the rights of a given user against a given locale according to the ".Edit.locales" the user has assigned for the given bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkUserAgainstLocale

public static net.sf.json.JSONObject checkUserAgainstLocale(net.sf.json.JSONObject prevError, Bundle bundle, ServiceRequest request,
                                                            java.util.Locale locale)
checks the rights of a given user against a given locale according to the ".Edit.locales" the user has assigned for the given bundle.

Returns a JSONObject error = { e: {String} error } if checks fail, null otherwise.

Parameters:
prevError - an error (NOT user-related) that has occurred earlier, or null
bundle - the Bundle of the caller
request - the ServiceRequest of the caller
locale - the Locale to check the Users rights for
Returns:
a JSONObject error if checks fail, null otherwise.

checkUserAgainstLocale

public static net.sf.json.JSONObject checkUserAgainstLocale(Bundle bundle, ServiceRequest request,
                                                            java.util.Locale locale)
checks the rights of a given user against a given locale according to the ".Edit.locales" the user has assigned for the given bundle.

Returns a JSONObject error = { e: {String} error } if checks fail, null otherwise.

Parameters:
bundle - the Bundle of the caller
request - the ServiceRequest of the caller
locale - the Locale to check the Users rights for
Returns:
a JSONObject error if checks fail, null otherwise.