public class SwordAuthenticator extends Object
| Constructor and Description |
|---|
SwordAuthenticator() |
| Modifier and Type | Method and Description |
|---|---|
SwordContext |
authenticate(org.swordapp.server.AuthCredentials auth)
Authenticate the given service document request.
|
boolean |
authenticates(Context context,
String un,
String pw)
Does the given username and password authenticate for the
given DSpace Context?
|
boolean |
canSubmit(SwordContext swordContext,
DSpaceObject dso,
VerboseDescription msg)
Can the users contained in this object's member SwordContext
make a successful submission to the selected collection.
|
boolean |
canSubmitTo(SwordContext swordContext,
Collection collection)
Can the current SWORD Context permit deposit into the given
collection in the given DSpace Context?
IF: the authenticated user is an administrator
AND:
(the on-behalf-of user is an administrator
OR the on-behalf-of user is authorised to ADD
OR the on-behalf-of user is null)
OR IF: the authenticated user is authorised to ADD
AND:
(the on-behalf-of user is an administrator
OR the on-behalf-of user is authorised to ADD
OR the on-behalf-of user is null)
|
boolean |
canSubmitTo(SwordContext context,
DSpaceObject dso)
Can the given context submit to the specified DSpace object?
This forwards to the individual methods for different object types;
see their documentation for details of the conditions.
|
boolean |
canSubmitTo(SwordContext swordContext,
Item item) |
List<Collection> |
getAllowedCollections(SwordContext swordContext)
Get an array of all the collections that the current SWORD
context will allow deposit onto in the given DSpace context
Forwards to:
getAllowedCollections(swordContext, null)
See that method for details of the conditions applied
|
List<Collection> |
getAllowedCollections(SwordContext swordContext,
Community community)
Get an array of all the collections that the current SWORD
context will allow deposit onto in the given DSpace context
IF: the authenticated user is an administrator
AND:
(the on-behalf-of user is an administrator
OR the on-behalf-of user is authorised to ADD
OR the on-behalf-of user is null)
OR IF: the authenticated user is authorised to ADD
AND:
(the on-behalf-of user is an administrator
OR the on-behalf-of user is authorised to ADD
OR the on-behalf-of user is null)
|
List<Community> |
getAllowedCommunities(SwordContext swordContext)
Get an array of all the communities that the current SWORD
context will allow deposit onto in the given DSpace context
The user may submit to a community if the following conditions
are met:
IF: the authenticated user is an administrator
AND:
(the on-behalf-of user is an administrator
OR the on-behalf-of user is authorised to READ
OR the on-behalf-of user is null)
OR IF: the authenticated user is authorised to READ
AND:
(the on-behalf-of user is an administrator
OR the on-behalf-of user is authorised to READ
OR the on-behalf-of user is null)
|
List<Item> |
getAllowedItems(SwordContext swordContext,
Collection collection)
Get a list of all the items that the current SWORD
context will allow deposit onto in the given DSpace context
IF: the authenticated user is an administrator
AND:
(the on-behalf-of user is an administrator
OR the on-behalf-of user is authorised to WRITE on the item and ADD on the ORIGINAL bundle
OR the on-behalf-of user is null)
OR IF: the authenticated user is authorised to WRITE on the item and ADD on the ORIGINAL bundle
AND:
(the on-behalf-of user is an administrator
OR the on-behalf-of user is authorised to WRITE on the item and ADD on the ORIGINAL bundle
OR the on-behalf-of user is null)
|
List<Community> |
getCommunities(SwordContext swordContext,
Community community)
Get an array of all the collections that the current SWORD
context will allow deposit onto in the given DSpace context
The user may submit to a community if the following conditions
are met:
IF: the authenticated user is an administrator
AND:
(the on-behalf-of user is an administrator
OR the on-behalf-of user is authorised to READ
OR the on-behalf-of user is null)
OR IF: the authenticated user is authorised to READ
AND:
(the on-behalf-of user is an administrator
OR the on-behalf-of user is authorised to READ
OR the on-behalf-of user is null)
|
boolean |
isInGroup(Group group,
EPerson eperson)
Is the given eperson in the given group, or any of the groups
that are also members of that group.
|
boolean |
isOnBehalfOfAdmin(SwordContext swordContext)
Is the given onBehalfOf user DSpace administrator? This translates
as asking the question of whether the given eperson is a member
of the special DSpace group Administrator, with id 1
|
boolean |
isOnBehalfOfInGroup(SwordContext swordContext,
Group group)
Is the onBehalfOf user a member of the given group or
one of its sub groups?
|
boolean |
isUserAdmin(SwordContext swordContext)
Is the authenticated user a DSpace administrator? This translates
as asking the question of whether the given eperson is a member
of the special DSpace group Administrator, with id 1
|
boolean |
isUserInGroup(SwordContext swordContext,
Group group)
Is the authenticated user a member of the given group
or one of its sub groups?
|
public boolean authenticates(Context context, String un, String pw)
context - un - pw - public SwordContext authenticate(org.swordapp.server.AuthCredentials auth) throws DSpaceSwordException, org.swordapp.server.SwordError, org.swordapp.server.SwordAuthException
auth - DSpaceSwordExceptionorg.swordapp.server.SwordErrororg.swordapp.server.SwordAuthExceptionpublic boolean canSubmit(SwordContext swordContext, DSpaceObject dso, VerboseDescription msg) throws DSpaceSwordException, org.swordapp.server.SwordError
DSpaceSwordExceptionorg.swordapp.server.SwordErrorpublic boolean isUserAdmin(SwordContext swordContext) throws DSpaceSwordException
swordContext - SQLExceptionDSpaceSwordExceptionpublic boolean isOnBehalfOfAdmin(SwordContext swordContext) throws DSpaceSwordException
swordContext - SQLExceptionDSpaceSwordExceptionpublic boolean isUserInGroup(SwordContext swordContext, Group group)
group - public boolean isOnBehalfOfInGroup(SwordContext swordContext, Group group)
group - public boolean isInGroup(Group group, EPerson eperson)
group - eperson - public List<Community> getAllowedCommunities(SwordContext swordContext) throws DSpaceSwordException
swordContext - DSpaceSwordExceptionpublic List<Community> getCommunities(SwordContext swordContext, Community community) throws DSpaceSwordException
community - DSpaceSwordExceptionpublic List<Collection> getAllowedCollections(SwordContext swordContext) throws DSpaceSwordException
swordContext - DSpaceSwordExceptionpublic List<Collection> getAllowedCollections(SwordContext swordContext, Community community) throws DSpaceSwordException
swordContext - DSpaceSwordExceptionpublic List<Item> getAllowedItems(SwordContext swordContext, Collection collection) throws DSpaceSwordException
swordContext - DSpaceSwordExceptionpublic boolean canSubmitTo(SwordContext swordContext, Collection collection) throws DSpaceSwordException
swordContext - collection - DSpaceSwordExceptionpublic boolean canSubmitTo(SwordContext swordContext, Item item) throws DSpaceSwordException
DSpaceSwordExceptionpublic boolean canSubmitTo(SwordContext context, DSpaceObject dso) throws DSpaceSwordException
context - dso - DSpaceSwordExceptionCopyright © 2013 DuraSpace. All Rights Reserved.