|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--blackboard.platform.security.SecurityUtil
This class provides some utility methods for security logic.
| Constructor Summary | |
SecurityUtil()
|
|
| Method Summary | |
static void |
checkPermission(java.security.Permission perm)
Performs a check for the specified permission against the installed SecurityManager.
|
static boolean |
userHasAllEntitlements(Id userId,
Id courseId,
Entitlements entitlements)
userHasAllEntitlements Logical AND Use for fine-grained authorization --User may have be entitled access to a page, but not a given widget on the page |
static boolean |
userHasAllEntitlements(java.lang.String[] entitlementNames,
javax.servlet.http.HttpServletRequest request)
userHasAllEntitlements Logical AND Use for fine-grained authorization --User may have be entitled access to a page, but not a given widget on the page --No user id param; implicit Context object assumed |
static boolean |
userHasAllEntitlements(User user,
Course course,
Entitlements entitlements)
userHasAllEntitlements Logical AND Use for fine-grained authorization -- a user may have be entitled access to a page, but not a given widget on the page Please note that this method should be used for most entitlements checks, since it does not require loading the User from the database. |
static boolean |
userHasAnyEntitlements(Id userId,
Id courseId,
Entitlements entitlements)
userHasAnyEntitlements Logical OR Use for coarse-grained authorization; for example to check whether user may enter admin page --User may have be entitled access to some but not all widgets on the page --User id param; implicit Context object _not_ assumed |
static boolean |
userHasAnyEntitlements(java.lang.String[] entitlementNames,
javax.servlet.http.HttpServletRequest request)
userHasAnyEntitlements Logical OR Use for coarse-grained authorization; for example to check whether user may enter admin page --User may have be entitled access to some but not all widgets on the page --No user id param; implicit Context object assumed |
static boolean |
userHasAnyEntitlements(User user,
Course course,
CourseMembership courseMembership,
Entitlements entitlements)
userHasAnyEntitlements Logical OR Use for coarse-grained authorization; for example to check whether user may enter admin page --User may have be entitled access to some but not all widgets on the page --User id param; implicit Context object _not_ assumed |
static boolean |
userHasEntitlement(Id userId,
Id courseId,
Entitlement entitlement)
userHasEntitlement Explicit check for a single entitlement Please note that this interface method assumes that the ContextManager has already set the context appropriately, so that this method can load user and course data for the correct virtual installation. |
static boolean |
userHasEntitlement(java.lang.String entitlementName,
javax.servlet.http.HttpServletRequest request)
userHasEntitlement --Explicit check for a single entitlement --No user id param; implicit Context object assumed |
static boolean |
userHasEntitlement(User user,
Course course,
CourseMembership courseMembership,
Entitlement entitlement)
userHasEntitlement Explicit check for a single entitlement. |
static boolean |
userHasEntitlement(User user,
Course course,
Entitlement entitlement)
userHasEntitlement Explicit check for a single entitlement. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SecurityUtil()
| Method Detail |
public static void checkPermission(java.security.Permission perm)
SecurityManager.
If no SecurityManager is installed, this is a no-op.
perm - The permission to check. For convenience, this may be null. The result is a no-op.
public static boolean userHasEntitlement(java.lang.String entitlementName,
javax.servlet.http.HttpServletRequest request)
public static boolean userHasEntitlement(Id userId,
Id courseId,
Entitlement entitlement)
entitlement -
public static boolean userHasEntitlement(User user,
Course course,
Entitlement entitlement)
user - the current User, usually stored in the Context for this threadcourse - the current Course, usually stored in the Context for this threadentitlement - the Entitlement in question
public static boolean userHasEntitlement(User user,
Course course,
CourseMembership courseMembership,
Entitlement entitlement)
user - the current User, usually stored in the Context for this threadcourse - the current Course, usually stored in the Context for this threadentitlement - the Entitlement in question
public static boolean userHasAllEntitlements(java.lang.String[] entitlementNames,
javax.servlet.http.HttpServletRequest request)
public static boolean userHasAllEntitlements(Id userId,
Id courseId,
Entitlements entitlements)
public static boolean userHasAllEntitlements(User user,
Course course,
Entitlements entitlements)
user - the current User, stored in the Context for this threadcourse - the current Course, stored in the Context for this threadentitlements - the set of Entitlements in question
public static boolean userHasAnyEntitlements(java.lang.String[] entitlementNames,
javax.servlet.http.HttpServletRequest request)
public static boolean userHasAnyEntitlements(User user,
Course course,
CourseMembership courseMembership,
Entitlements entitlements)
public static boolean userHasAnyEntitlements(Id userId,
Id courseId,
Entitlements entitlements)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||