mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
@@ -0,0 +1,33 @@
|
||||
package org.dspace.app.rest.authorization.impl;
|
||||
|
||||
import org.dspace.app.rest.authorization.AuthorizationFeature;
|
||||
import org.dspace.app.rest.authorization.AuthorizationFeatureDocumentation;
|
||||
import org.dspace.app.rest.model.BaseObjectRest;
|
||||
import org.dspace.app.rest.model.SiteRest;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.discovery.SearchServiceException;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
@Component
|
||||
@AuthorizationFeatureDocumentation(name = CoarNotifyLdnEnabled.NAME,
|
||||
description = "It can be used to verify if the user can see the coar notify protocol is enabled")
|
||||
public class CoarNotifyLdnEnabled implements AuthorizationFeature {
|
||||
|
||||
public final static String NAME = "coarLdnEnabled";
|
||||
|
||||
@Autowired
|
||||
private ConfigurationService configurationService;
|
||||
@Override
|
||||
public boolean isAuthorized(Context context, BaseObjectRest object) throws SQLException, SearchServiceException {
|
||||
return configurationService.getBooleanProperty("coar-notify.enabled", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getSupportedTypes() {
|
||||
return new String[]{SiteRest.CATEGORY+"."+SiteRest.NAME};
|
||||
}
|
||||
}
|
@@ -1694,3 +1694,4 @@ include = ${module_dir}/usage-statistics.cfg
|
||||
include = ${module_dir}/versioning.cfg
|
||||
include = ${module_dir}/workflow.cfg
|
||||
include = ${module_dir}/external-providers.cfg
|
||||
include = ${module_dir}/coar-notify-ldn.cfg
|
||||
|
9
dspace/config/modules/coar-notify-ldn.cfg
Normal file
9
dspace/config/modules/coar-notify-ldn.cfg
Normal file
@@ -0,0 +1,9 @@
|
||||
#---------------------------------------------------------------#
|
||||
#---------------COAR NOTIFY LDN CONFIGURATION-------------------#
|
||||
#---------------------------------------------------------------#
|
||||
# Configuration properties used by Coar Notify and ldn #
|
||||
#---------------------------------------------------------------#
|
||||
|
||||
#Boolean to determine if Coar Notify is enabled globally for entire site.
|
||||
#default => true
|
||||
coar-notify.enabled = true
|
@@ -52,6 +52,7 @@ rest.properties.exposed = google.recaptcha.mode
|
||||
rest.properties.exposed = cc.license.jurisdiction
|
||||
rest.properties.exposed = identifiers.item-status.register-doi
|
||||
rest.properties.exposed = authentication-password.domain.valid
|
||||
rest.properties.exposed = coar-notify.enabled
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# These configs are used by the deprecated REST (v4-6) module #
|
||||
|
Reference in New Issue
Block a user