Add toString() methods to help in debugging; remove commented code and unused imports.
This commit is contained in:
parent
44c1de7b4e
commit
6b9f448dc2
9 changed files with 50 additions and 113 deletions
|
@ -40,6 +40,6 @@ public class CuratorEditingIdentifierFactory implements IdentifierBundleFactory{
|
||||||
|
|
||||||
public String getUri(){ return uri; }
|
public String getUri(){ return uri; }
|
||||||
|
|
||||||
public String toString(){ return uri; }
|
public String toString(){ return "CuratorEditingId: " + uri; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class DbAdminEditingIdentifierFactory implements IdentifierBundleFactory{
|
||||||
public String getUri(){ return uri; }
|
public String getUri(){ return uri; }
|
||||||
|
|
||||||
public String toString(){
|
public String toString(){
|
||||||
return "DbAdmin role of " + getRole();
|
return "DbAdminEditingId: role of " + getRole();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.auth.identifier;
|
package edu.cornell.mannlib.vitro.webapp.auth.identifier;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.SelfEditingIdentifierFactory.SelfEditing;
|
|
||||||
|
|
||||||
public abstract class RoleIdentifier implements Identifier {
|
public abstract class RoleIdentifier implements Identifier {
|
||||||
public abstract String getRole();
|
public abstract String getRole();
|
||||||
public abstract String getUri();
|
public abstract String getUri();
|
||||||
|
|
|
@ -33,22 +33,19 @@ import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||||
/**
|
/**
|
||||||
* Pulls a netId out of the CUWebAuth REMOTE_USER header.
|
* Pulls a netId out of the CUWebAuth REMOTE_USER header.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @author bdc34
|
* @author bdc34
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class SelfEditingIdentifierFactory implements IdentifierBundleFactory {
|
public class SelfEditingIdentifierFactory implements IdentifierBundleFactory {
|
||||||
public final static String httpHeaderForNetId = "REMOTE_USER";
|
public final static String httpHeaderForNetId = "REMOTE_USER";
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(SelfEditingIdentifierFactory.class.getName());
|
private static final Log log = LogFactory.getLog(SelfEditingIdentifierFactory.class.getName());
|
||||||
|
|
||||||
|
|
||||||
public IdentifierBundle getIdentifierBundle(ServletRequest request, HttpSession session, ServletContext context) {
|
public IdentifierBundle getIdentifierBundle(ServletRequest request, HttpSession session, ServletContext context) {
|
||||||
IdentifierBundle idb = getFromCUWebAuthHeader(request,session,context);
|
IdentifierBundle idb = getFromCUWebAuthHeader(request,session,context);
|
||||||
if( idb != null )
|
if( idb != null )
|
||||||
return idb;
|
return idb;
|
||||||
else
|
else
|
||||||
return getFromSession(request,session);
|
return getFromSession(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IdentifierBundle getFromCUWebAuthHeader(ServletRequest request, HttpSession session,ServletContext context){
|
private IdentifierBundle getFromCUWebAuthHeader(ServletRequest request, HttpSession session,ServletContext context){
|
||||||
|
@ -100,7 +97,6 @@ public class SelfEditingIdentifierFactory implements IdentifierBundleFactory {
|
||||||
}
|
}
|
||||||
putNetIdInSession(session, selfE, netid);
|
putNetIdInSession(session, selfE, netid);
|
||||||
return idb;
|
return idb;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -139,7 +135,7 @@ public class SelfEditingIdentifierFactory implements IdentifierBundleFactory {
|
||||||
break;
|
break;
|
||||||
}catch(RuntimeException ex){
|
}catch(RuntimeException ex){
|
||||||
log.error("Could not run blacklist check query for file " +
|
log.error("Could not run blacklist check query for file " +
|
||||||
file.getAbsolutePath() + file.separatorChar + file.getName(),
|
file.getAbsolutePath() + File.separatorChar + file.getName(),
|
||||||
ex);
|
ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,7 +210,7 @@ public class SelfEditingIdentifierFactory implements IdentifierBundleFactory {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IdentifierBundle getFromSession(ServletRequest req, HttpSession session ){
|
private IdentifierBundle getFromSession( HttpSession session ){
|
||||||
if (session == null) {
|
if (session == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -258,7 +254,7 @@ public class SelfEditingIdentifierFactory implements IdentifierBundleFactory {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
public String getValue(){return value;}
|
public String getValue(){return value;}
|
||||||
public String toString(){ return value;}
|
public String toString(){ return "NetID: " + value;}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,11 @@ public class UserToIndIdentifierFactory implements IdentifierBundleFactory {
|
||||||
}
|
}
|
||||||
public List<String> getMayEditAsURIs() {
|
public List<String> getMayEditAsURIs() {
|
||||||
return mayEditAsURIs;
|
return mayEditAsURIs;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "UserIdentifier: " + userURI;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class RoleBasedPolicy extends DefaultInconclusivePolicy implements Polic
|
||||||
/**
|
/**
|
||||||
* What is the minimum AuthRole needed to perform a given action?
|
* What is the minimum AuthRole needed to perform a given action?
|
||||||
*/
|
*/
|
||||||
private static Map<Class,AuthRole> actionToMinRole = new HashMap<Class,AuthRole>();
|
private static Map<Class<?>,AuthRole> actionToMinRole = new HashMap<Class<?>,AuthRole>();
|
||||||
static{
|
static{
|
||||||
//anybody actions
|
//anybody actions
|
||||||
//view resources?
|
//view resources?
|
||||||
|
@ -103,7 +103,7 @@ public class RoleBasedPolicy extends DefaultInconclusivePolicy implements Polic
|
||||||
|
|
||||||
//We need to find the class of the RequestedAction since that
|
//We need to find the class of the RequestedAction since that
|
||||||
//encodes what type of action is being requested.
|
//encodes what type of action is being requested.
|
||||||
Class requesetClass = whatToAuth.getClass();
|
Class<?> requesetClass = whatToAuth.getClass();
|
||||||
AuthRole minmumRoleForAction = actionToMinRole.get(requesetClass);
|
AuthRole minmumRoleForAction = actionToMinRole.get(requesetClass);
|
||||||
|
|
||||||
if( minmumRoleForAction == null ){
|
if( minmumRoleForAction == null ){
|
||||||
|
@ -118,33 +118,14 @@ public class RoleBasedPolicy extends DefaultInconclusivePolicy implements Polic
|
||||||
return new BasicPolicyDecision(Authorization.UNAUTHORIZED,"not authorized for role");
|
return new BasicPolicyDecision(Authorization.UNAUTHORIZED,"not authorized for role");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Because it extends AbstractPolicySetup and implements this method, RoleBasedPolicy
|
public String toString() {
|
||||||
* can be used as a ServletContextListener that puts its self on the ServletPolicyList
|
return "RoleBasedPolicy";
|
||||||
* at servlet context initialization.
|
}
|
||||||
*
|
|
||||||
* Notice that this method also setups the IdentifierBundleFactory that it needs.
|
|
||||||
*/
|
|
||||||
// @Override
|
|
||||||
// public List<PolicyIface> createPolicies(ServletContextEvent sce) {
|
|
||||||
// List<PolicyIface> list = new ArrayList<PolicyIface>(1);
|
|
||||||
// list.add(new RoleBasedPolicy());
|
|
||||||
//
|
|
||||||
// //notice that the idBundleFactory gets created here,
|
|
||||||
// JenaRoleIdentifierBundleFactory jibf = new JenaRoleIdentifierBundleFactory(userModelUri);
|
|
||||||
// ServletIdentifierBundleFactory.addIdentifierBundleFactory(sce.getServletContext(),jibf);
|
|
||||||
//
|
|
||||||
// return list;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/********************** Roles *****************************************/
|
|
||||||
|
/********************** Roles *****************************************/
|
||||||
public static enum AuthRole implements Identifier {
|
public static enum AuthRole implements Identifier {
|
||||||
// ANYBODY("http://vitro.mannlib.cornell.edu/authRole#anybody",0),
|
|
||||||
// USER("http://vitro.mannlib.cornell.edu/authRole#user",1),
|
|
||||||
// EDITOR("http://vitro.mannlib.cornell.edu/authRole#editor",2),
|
|
||||||
// CURATOR("http://vitro.mannlib.cornell.edu/authRole#curator",3),
|
|
||||||
// DBA("http://vitro.mannlib.cornell.edu/authRole#dba",50);
|
|
||||||
|
|
||||||
ANYBODY( "role:/0" ,LoginStatusBean.ANYBODY),
|
ANYBODY( "role:/0" ,LoginStatusBean.ANYBODY),
|
||||||
USER( "role:/1" ,LoginStatusBean.NON_EDITOR),
|
USER( "role:/1" ,LoginStatusBean.NON_EDITOR),
|
||||||
EDITOR( "role:/4" ,LoginStatusBean.EDITOR),
|
EDITOR( "role:/4" ,LoginStatusBean.EDITOR),
|
||||||
|
@ -181,5 +162,10 @@ public class RoleBasedPolicy extends DefaultInconclusivePolicy implements Polic
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "AuthRole: " + name();
|
||||||
|
}
|
||||||
}/* end of enum AuthRole */
|
}/* end of enum AuthRole */
|
||||||
}/* end of class RoleBasedPolicy */
|
}/* end of class RoleBasedPolicy */
|
||||||
|
|
|
@ -4,35 +4,18 @@ package edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
|
import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.policy.BasicPolicyDecision;
|
import edu.cornell.mannlib.vitro.webapp.auth.policy.BasicPolicyDecision;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AddDataPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AddObjectPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AddResource;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.DropDataPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.DropObjectPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.DropResource;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.EditDataPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.EditObjPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.AddNewUser;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.LoadOntology;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.RebuildTextIndex;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.RemoveUser;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.ServerStatus;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.UpdateTextIndex;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.UploadFile;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ontology.CreateOwlClass;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ontology.DefineDataProperty;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ontology.DefineObjectProperty;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ontology.RemoveOwlClass;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a policy where every type of action is authorized as INCONCLUSIVE
|
* a policy where every type of action is authorized as INCONCLUSIVE
|
||||||
* by default.
|
* by default.
|
||||||
*
|
*
|
||||||
* @author bdc34
|
* @author bdc34
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class DefaultAuthorizedPolicy implements PolicyIface{
|
public class DefaultAuthorizedPolicy implements PolicyIface{
|
||||||
|
protected static PolicyDecision AUTHORIZED_DECISION = new BasicPolicyDecision(
|
||||||
|
Authorization.AUTHORIZED,
|
||||||
|
"This is the default decision defined in DefaultAuthorizedPolicy");
|
||||||
|
|
||||||
public PolicyDecision isAuthorized(IdentifierBundle whoToAuth,
|
public PolicyDecision isAuthorized(IdentifierBundle whoToAuth,
|
||||||
RequestedAction whatToAuth) {
|
RequestedAction whatToAuth) {
|
||||||
|
@ -45,7 +28,8 @@ public class DefaultAuthorizedPolicy implements PolicyIface{
|
||||||
return AUTHORIZED_DECISION;
|
return AUTHORIZED_DECISION;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static PolicyDecision AUTHORIZED_DECISION = new BasicPolicyDecision(
|
@Override
|
||||||
Authorization.AUTHORIZED,
|
public String toString() {
|
||||||
"This is the default decision defined in DefaultAuthorizedPolicy");
|
return "DefaultAuthorizedPolicy";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,35 +4,17 @@ package edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
|
import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.policy.BasicPolicyDecision;
|
import edu.cornell.mannlib.vitro.webapp.auth.policy.BasicPolicyDecision;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AddDataPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AddObjectPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AddResource;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.DropDataPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.DropObjectPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.DropResource;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.EditDataPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.EditObjPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.AddNewUser;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.LoadOntology;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.RebuildTextIndex;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.RemoveUser;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.ServerStatus;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.UpdateTextIndex;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.UploadFile;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ontology.CreateOwlClass;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ontology.DefineDataProperty;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ontology.DefineObjectProperty;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ontology.RemoveOwlClass;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A policy where every type of action is authorized as INCONCLUSIVE
|
* A policy where every type of action is authorized as INCONCLUSIVE by default.
|
||||||
* by default.
|
*
|
||||||
*
|
|
||||||
* @author bdc34
|
* @author bdc34
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class DefaultInconclusivePolicy implements PolicyIface{
|
public class DefaultInconclusivePolicy implements PolicyIface {
|
||||||
|
protected static PolicyDecision INCONCLUSIVE_DECISION = new BasicPolicyDecision(
|
||||||
|
Authorization.INCONCLUSIVE,
|
||||||
|
"This is the default decision defined in DefaultInconclusivePolicy");
|
||||||
|
|
||||||
public PolicyDecision isAuthorized(IdentifierBundle whoToAuth,
|
public PolicyDecision isAuthorized(IdentifierBundle whoToAuth,
|
||||||
RequestedAction whatToAuth) {
|
RequestedAction whatToAuth) {
|
||||||
|
@ -44,7 +26,10 @@ public class DefaultInconclusivePolicy implements PolicyIface{
|
||||||
"null was passed as whatToAuth");
|
"null was passed as whatToAuth");
|
||||||
return INCONCLUSIVE_DECISION;
|
return INCONCLUSIVE_DECISION;
|
||||||
}
|
}
|
||||||
protected static PolicyDecision INCONCLUSIVE_DECISION = new BasicPolicyDecision(
|
|
||||||
Authorization.INCONCLUSIVE,
|
@Override
|
||||||
"This is the default decision defined in DefaultInconclusivePolicy");
|
public String toString() {
|
||||||
|
return "DefaultInconclusivePolicy";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,41 +4,19 @@ package edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
|
import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.policy.BasicPolicyDecision;
|
import edu.cornell.mannlib.vitro.webapp.auth.policy.BasicPolicyDecision;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AddDataPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AddObjectPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AddResource;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.DropDataPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.DropObjectPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.DropResource;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.EditDataPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.EditObjPropStmt;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.AddNewUser;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.LoadOntology;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.RebuildTextIndex;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.RemoveUser;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.ServerStatus;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.UpdateTextIndex;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.admin.UploadFile;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ontology.CreateOwlClass;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ontology.DefineDataProperty;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ontology.DefineObjectProperty;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ontology.RemoveOwlClass;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*a policy where every type of action is authorized as UNAUTHORIZED
|
*a policy where every type of action is authorized as UNAUTHORIZED
|
||||||
* by default. This can be useful for a unauthenticated session or
|
* by default. This can be useful for a unauthenticated session or
|
||||||
* as the last policy on a PolicyList to force INCONCLUSIVE decisions
|
* as the last policy on a PolicyList to force INCONCLUSIVE decisions
|
||||||
* to UNAUTHORIZED.
|
* to UNAUTHORIZED.
|
||||||
*/
|
*/
|
||||||
public class DefaultUnauthorizedPolicy implements PolicyIface{
|
public class DefaultUnauthorizedPolicy implements PolicyIface{
|
||||||
|
|
||||||
protected static PolicyDecision UNAUTHORIZED_DECISION = new BasicPolicyDecision(
|
protected static PolicyDecision UNAUTHORIZED_DECISION = new BasicPolicyDecision(
|
||||||
Authorization.UNAUTHORIZED,
|
Authorization.UNAUTHORIZED,
|
||||||
"This is the default decision defined in DefaultUnauthorizedPolicy");
|
"This is the default decision defined in DefaultUnauthorizedPolicy");
|
||||||
|
|
||||||
|
|
||||||
public PolicyDecision isAuthorized(IdentifierBundle whoToAuth,
|
public PolicyDecision isAuthorized(IdentifierBundle whoToAuth,
|
||||||
RequestedAction whatToAuth) {
|
RequestedAction whatToAuth) {
|
||||||
if (whoToAuth == null)
|
if (whoToAuth == null)
|
||||||
|
@ -48,5 +26,10 @@ public class DefaultUnauthorizedPolicy implements PolicyIface{
|
||||||
return new BasicPolicyDecision(Authorization.UNAUTHORIZED,
|
return new BasicPolicyDecision(Authorization.UNAUTHORIZED,
|
||||||
"null was passed as whatToAuth");
|
"null was passed as whatToAuth");
|
||||||
return UNAUTHORIZED_DECISION;
|
return UNAUTHORIZED_DECISION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "DefaultInconclusivePolicy";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue