Class CanClaimItemFeature
- java.lang.Object
-
- org.dspace.app.rest.authorization.impl.CanClaimItemFeature
-
- All Implemented Interfaces:
AuthorizationFeature
@Component @AuthorizationFeatureDocumentation(name="canClaimItem", description="Used to verify if the current user is able to claim this item as their profile. Only available if the current item is not already claimed.") public class CanClaimItemFeature extends Object implements AuthorizationFeature
Checks if the given user can claim the given item. An item can be claimed only if the show claim is enabled for it (seeorg.dspace.app.rest.authorization.impl.ShowClaimItemFeature).- Author:
- Luca Giamminonni (luca.giamminonni at 4science.it)
-
-
Constructor Summary
Constructors Constructor Description CanClaimItemFeature()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]getSupportedTypes()Return the supported object type according to theRestAddressableModel.getUniqueType()booleanisAuthorized(Context context, BaseObjectRest object)Check if the eperson in the provided context, or the anonymous user if not loggedin, has access to the feature for the requested object-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.dspace.app.rest.authorization.AuthorizationFeature
getDescription, getName
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
isAuthorized
public boolean isAuthorized(Context context, BaseObjectRest object) throws SQLException
Description copied from interface:AuthorizationFeatureCheck if the eperson in the provided context, or the anonymous user if not loggedin, has access to the feature for the requested object- Specified by:
isAuthorizedin interfaceAuthorizationFeature- Parameters:
context- the DSpace Contextobject- the object target by the feature (MUST be NOT null). Use theSiteRestobject for repository wide feature- Returns:
- true if the user associated with the context has access to the feature for the specified object
- Throws:
SQLException
-
getSupportedTypes
public String[] getSupportedTypes()
Description copied from interface:AuthorizationFeatureReturn the supported object type according to theRestAddressableModel.getUniqueType()- Specified by:
getSupportedTypesin interfaceAuthorizationFeature- Returns:
- the supported object type, required to be not null
-
-