Class AuthorizationFeatureServiceImpl
java.lang.Object
org.dspace.app.rest.authorization.impl.AuthorizationFeatureServiceImpl
- All Implemented Interfaces:
AuthorizationFeatureService
@Service
public class AuthorizationFeatureServiceImpl
extends Object
implements AuthorizationFeatureService
This is the default implementation of the
AuthorizationFeatureService. It is based on the spring autowiring
feature to discover all the features available in the system- Author:
- Andrea Bollini (andrea.bollini at 4science.it)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the authorization feature by its unique namefindAll()Get all the authorization features defined in the systemfindByResourceType(String categoryDotType) Return all the feature that apply to the rest resources identified by the uniqueType string category.modelbooleanisAuthorized(Context context, AuthorizationFeature feature, BaseObjectRest object) Check if the eperson in the provided context, or the anonymous user if not loggedin, has access to the requested feature for the requested object
-
Constructor Details
-
AuthorizationFeatureServiceImpl
public AuthorizationFeatureServiceImpl()
-
-
Method Details
-
isAuthorized
public boolean isAuthorized(Context context, AuthorizationFeature feature, BaseObjectRest object) throws SQLException, SearchServiceException Description copied from interface:AuthorizationFeatureServiceCheck if the eperson in the provided context, or the anonymous user if not loggedin, has access to the requested feature for the requested object- Specified by:
isAuthorizedin interfaceAuthorizationFeatureService- Parameters:
context- the DSpace Contextfeature- the Authorization Feature to checkobject- the object target by the feature. Passing a null object always return false. To check repository wide feature pass theSiteRestobject- Returns:
- true if the user associated with the context has access to the feature
- Throws:
SQLExceptionSearchServiceException
-
findAll
Description copied from interface:AuthorizationFeatureServiceGet all the authorization features defined in the system- Specified by:
findAllin interfaceAuthorizationFeatureService- Returns:
- a list of all the authorization features
-
find
Description copied from interface:AuthorizationFeatureServiceGet the authorization feature by its unique name- Specified by:
findin interfaceAuthorizationFeatureService- Parameters:
name- the authorization feature unique name- Returns:
- the authorization feature if any
-
findByResourceType
Description copied from interface:AuthorizationFeatureServiceReturn all the feature that apply to the rest resources identified by the uniqueType string category.model- Specified by:
findByResourceTypein interfaceAuthorizationFeatureService- Returns:
-