|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.turbine.util.SecurityCheck
Utility for doing security checks in Screens and Actions.
Sample usage:
SecurityCheck mycheck =
new SecurityCheck(data, "Unauthorized to do this!", "WrongPermission");
if (!mycheck.hasPermission("add_user");
return;
| Constructor Summary | |
SecurityCheck(RunData data,
java.lang.String message,
java.lang.String failedScreen)
Constructor. |
|
| Method Summary | |
java.lang.String |
getFailScreen()
Get the screen that should be displayed. |
java.lang.String |
getMessage()
Get the message that should be displayed. |
boolean |
hasPermission(Permission permission)
Does the user have this permission? |
boolean |
hasPermission(java.lang.String permission)
Does the user have this permission? |
boolean |
hasRole(Role role)
Does the user have this role? |
boolean |
hasRole(java.lang.String role)
Does the user have this role? |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SecurityCheck(RunData data,
java.lang.String message,
java.lang.String failedScreen)
data - A Turbine RunData object.message - The message to display upon failure.failedScreen - The screen to redirect to upon failure.| Method Detail |
public boolean hasRole(Role role)
throws java.lang.Exception
role - A Role.
Exception, - a generic exception.
java.lang.Exception
public boolean hasRole(java.lang.String role)
throws java.lang.Exception
role - A String.
Exception, - a generic exception.
java.lang.Exception
public boolean hasPermission(Permission permission)
throws java.lang.Exception
permission - A Permission.
Exception, - a generic exception.
java.lang.Exception
public boolean hasPermission(java.lang.String permission)
throws java.lang.Exception
permission - A String.
Exception, - a generic exception.
java.lang.Exceptionpublic java.lang.String getMessage()
public java.lang.String getFailScreen()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||