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 theAuthorizationFeatureService. 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 Constructor Description AuthorizationFeatureServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthorizationFeaturefind(String name)Get the authorization feature by its unique nameList<AuthorizationFeature>findAll()Get all the authorization features defined in the systemList<AuthorizationFeature>findByResourceType(String categoryDotType)Return all the feature that apply to the rest resources identified by the uniqueType string category.modelbooleanisAuthorized(org.dspace.core.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
-
-
-
Method Detail
-
isAuthorized
public boolean isAuthorized(org.dspace.core.Context context, AuthorizationFeature feature, BaseObjectRest object) throws SQLExceptionDescription 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:
SQLException
-
findAll
public List<AuthorizationFeature> 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
public AuthorizationFeature find(String name)
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
public List<AuthorizationFeature> findByResourceType(String categoryDotType)
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:
-
-