com.groiss.org
Class DefaultRightCheck

java.lang.Object
  extended by com.groiss.org.DefaultRightCheck

public class DefaultRightCheck
extends java.lang.Object

This class provides the default implementation for right checks in @enterprise. In opposite to the corresponding methods in OrgData the methods of this class do always use the standard permission system and do not call the specialized methods if the passed object implements interface RightCheck. Therefore the main reason for this class is to enable implementors of RightCheck to call the standard permission system in those cases where no specialized behaviour is needed. For all other cases of checking whether a user has a specific right for a specific object use the methods of OrgData.


Constructor Summary
DefaultRightCheck()
           
 
Method Summary
static boolean hasRight(User user, Right r, Persistent p)
          Checks if the passed user has the passed right for the passed object
static
<P> java.util.List<P>
listWithRightCheck(User user, Right right, java.lang.Class<? extends P> c, java.lang.String condition, java.lang.String order, java.lang.Object[] args, Application app, boolean ignoreDepts)
          Returns a list of all objects of the passed class for which the passed user has the passed right and for which the condition matches.
static
<P> java.util.List<P>
listWithRightCheck(User user, Right right, java.lang.Class<P> c, java.lang.String condition, java.lang.String order, java.lang.Object[] args)
          Returns a list of all objects of the passed class for which the passed user has the passed right and for which the condition matches.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRightCheck

public DefaultRightCheck()
Method Detail

hasRight

public static boolean hasRight(User user,
                               Right r,
                               Persistent p)
Checks if the passed user has the passed right for the passed object

Parameters:
user - the user
r - the right
p - the object
Returns:
true if the user is authorized, false otherwise

listWithRightCheck

public static <P> java.util.List<P> listWithRightCheck(User user,
                                                       Right right,
                                                       java.lang.Class<P> c,
                                                       java.lang.String condition,
                                                       java.lang.String order,
                                                       java.lang.Object[] args)
Returns a list of all objects of the passed class for which the passed user has the passed right and for which the condition matches.

Type Parameters:
P - the class which instances are wanted
Parameters:
user - the user
right - the right
c - the class object
condition - a SQL condition
order - a comma separated list of attribute names of the given class.
Returns:
the list

listWithRightCheck

public static <P> java.util.List<P> listWithRightCheck(User user,
                                                       Right right,
                                                       java.lang.Class<? extends P> c,
                                                       java.lang.String condition,
                                                       java.lang.String order,
                                                       java.lang.Object[] args,
                                                       Application app,
                                                       boolean ignoreDepts)
Returns a list of all objects of the passed class for which the passed user has the passed right and for which the condition matches.

Type Parameters:
P - the class which instances are wanted
Parameters:
user - the user
right - the right
c - the class object
condition - a SQL condition
order - a comma separated list of attribute names of the given class.
app - the application which departement tree should be used for checking
ignoreDepts -
Returns:
the list


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.