add some methods for dynamic selection of authorizer
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1429312 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
860be7f218
commit
70d2aa24ed
|
@ -35,4 +35,16 @@ public interface Authorizer
|
|||
|
||||
AuthorizationResult isAuthorized( AuthorizationDataSource source )
|
||||
throws AuthorizationException;
|
||||
|
||||
/**
|
||||
* @return true if this implementation is a final one and not a wrapper
|
||||
* @since 2.1
|
||||
*/
|
||||
boolean isFinalImplementation();
|
||||
|
||||
/**
|
||||
* @return a key to be able to customize label in UI
|
||||
* @since 2.1
|
||||
*/
|
||||
String getDescriptionKey();
|
||||
}
|
||||
|
|
|
@ -42,4 +42,14 @@ public class LdapAuthorizer
|
|||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isFinalImplementation()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getDescriptionKey()
|
||||
{
|
||||
return "archiva.redback.authorizer.ldap";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,4 +45,14 @@ public class OpenAuthorizer
|
|||
return new AuthorizationResult( true, source.getPermission(), null );
|
||||
}
|
||||
|
||||
public boolean isFinalImplementation()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getDescriptionKey()
|
||||
{
|
||||
return "archiva.redback.authorizer.open";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -186,4 +186,14 @@ public class RbacAuthorizer
|
|||
{
|
||||
this.evaluator = evaluator;
|
||||
}
|
||||
|
||||
public boolean isFinalImplementation()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getDescriptionKey()
|
||||
{
|
||||
return "archiva.redback.authorizer.rbac";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,5 +54,15 @@ public class MemoryAuthorizer
|
|||
return new AuthorizationResult( false, principal, null );
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFinalImplementation()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getDescriptionKey()
|
||||
{
|
||||
return "archiva.redback.authorizer.memory";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue