Class Administration
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.Administration
- All Implemented Interfaces:
NewerNewStyleService
,STService
-
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, exptManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCapabilityToRole
(String role, String capability) void
addRolesToUser
(String projectName, String email, String[] roles) Adds the given roles to the user.void
clonePUBinding
(org.eclipse.rdf4j.model.IRI sourceUserIri, String sourceProjectName, org.eclipse.rdf4j.model.IRI targetUserIri, String targetProjectName) void
This service allows to create a role by cloning an existing one.void
createRole
(String roleName) void
deleteRole
(String roleName) void
downloadPrivacyStatement
(jakarta.servlet.http.HttpServletResponse oRes) void
exportRole
(jakarta.servlet.http.HttpServletResponse oRes, String roleName) Exports theCustomForm
with the given idGets the data directory pathcom.fasterxml.jackson.databind.JsonNode
getProjectUserBinding
(String projectName, String email) void
importRole
(org.springframework.web.multipart.MultipartFile inputFile, String newRoleName) Imports a new role in the current projectcom.fasterxml.jackson.databind.JsonNode
listCapabilities
(String projectName, String role) com.fasterxml.jackson.databind.JsonNode
void
removeAdministrator
(String email) void
removeCapabilityFromRole
(String role, String capability) void
removeRoleFromUser
(String projectName, String email, String role) void
removeSuperUser
(String email) void
removeUserFromProject
(String projectName, String email) Removes roles, languages and groups from the user in the given projectvoid
setAdministrator
(String email) void
setDataDir
(String path) void
setPreloadProfilerThreshold
(DataSize threshold) void
setSuperUser
(String email) void
testEmailConfig
(String mailTo, EmailApplicationContext appCtx) void
updateCapabilityForRole
(String role, String oldCapability, String newCapability) void
updateLanguagesOfUserInProject
(String projectName, String email, Collection<String> languages) Methods inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
addValue, checkNotLocallyDefined, createQueryBuilder, generateIRI, generateNatureSPARQLSelectPart, generateNatureSPARQLWherePart, generateResourceWithCustomConstructor, getCodaLexModeForSearchFromLexicalizationModel, getDeleteGraph, getGraphFromNature, getInitializedCodaCore, getManagedConnection, getMetadataGraph, getOptionalProject, getPlatformTransactionManager, getProject, getRepository, getRoleFromNature, getUserNamedGraphs, getWorkingGraph, instantiateSearchStrategy, instantiateSearchStrategy, parseReference, publishResourceDeleted, publishResourceDeleted, removeReifiedValue, retrieveResources, shutDownCodaCore, updateTriplePredicate
-
Constructor Details
-
Administration
public Administration()
-
-
Method Details
-
setAdministrator
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setAdministrator(String email) throws STPropertyUpdateException, UserException, STPropertyAccessException - Parameters:
email
-- Throws:
STPropertyUpdateException
UserException
STPropertyAccessException
-
removeAdministrator
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void removeAdministrator(String email) throws STPropertyUpdateException, UserException, STPropertyAccessException - Parameters:
email
-- Throws:
STPropertyUpdateException
UserException
STPropertyAccessException
-
setSuperUser
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setSuperUser(String email) throws STPropertyUpdateException, UserException, STPropertyAccessException - Parameters:
email
-- Throws:
STPropertyUpdateException
UserException
STPropertyAccessException
-
removeSuperUser
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void removeSuperUser(String email) throws STPropertyUpdateException, UserException, STPropertyAccessException - Parameters:
email
-- Throws:
STPropertyUpdateException
UserException
STPropertyAccessException
-
getDataDir
Gets the data directory path- Returns:
- Throws:
STPropertyAccessException
-
setDataDir
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setDataDir(String path) throws IOException - Throws:
IOException
-
setPreloadProfilerThreshold
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setPreloadProfilerThreshold(@Optional DataSize threshold) throws STPropertyUpdateException, STPropertyAccessException -
testEmailConfig
@STServiceOperation @PreAuthorize("@auth.isAdmin()") public void testEmailConfig(String mailTo, @Optional EmailApplicationContext appCtx) throws UnsupportedEncodingException, jakarta.mail.MessagingException, STPropertyAccessException - Parameters:
mailTo
-- Throws:
UnsupportedEncodingException
jakarta.mail.MessagingException
STPropertyAccessException
-
getProjectUserBinding
@STServiceOperation public com.fasterxml.jackson.databind.JsonNode getProjectUserBinding(String projectName, String email) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, UserException - Throws:
ProjectBindingException
org.json.JSONException
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
STPropertyAccessException
UserException
-
addRolesToUser
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorizedInProject(\'rbac(user, role)\', \'C\', #projectName)") public void addRolesToUser(String projectName, String email, String[] roles) throws ProjectBindingException, InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, UserException Adds the given roles to the user. -
removeUserFromProject
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorizedInProject(\'rbac(user, role)\', \'D\', #projectName)") public void removeUserFromProject(String projectName, String email) throws ProjectBindingException, InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, UserException Removes roles, languages and groups from the user in the given project -
removeRoleFromUser
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorizedInProject(\'rbac(user, role)\', \'D\', #projectName)") public void removeRoleFromUser(String projectName, String email, String role) throws ProjectBindingException, InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, UserException -
updateLanguagesOfUserInProject
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorizedInProject(\'rbac(user, role)\', \'U\', #projectName)") public void updateLanguagesOfUserInProject(String projectName, String email, Collection<String> languages) throws ProjectBindingException, InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, UserException -
listRoles
@STServiceOperation @PreAuthorize("@auth.isAuthorized(\'rbac(role)\', \'R\')") public com.fasterxml.jackson.databind.JsonNode listRoles(@Optional String projectName) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException -
listCapabilities
@STServiceOperation public com.fasterxml.jackson.databind.JsonNode listCapabilities(@Optional String projectName, String role) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, RBACException - Parameters:
projectName
-role
-- Returns:
- Throws:
InvalidProjectNameException
ProjectInexistentException
ProjectAccessException
RBACException
-
createRole
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'rbac(role)\', \'C\')") public void createRole(String roleName) throws RoleCreationException - Parameters:
roleName
-- Throws:
RoleCreationException
IOException
-
deleteRole
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'rbac(role)\', \'D\')") public void deleteRole(String roleName) throws ProjectBindingException - Parameters:
roleName
-- Throws:
ProjectBindingException
-
exportRole
@STServiceOperation @PreAuthorize("@auth.isAuthorized(\'rbac(role)\', \'R\')") public void exportRole(jakarta.servlet.http.HttpServletResponse oRes, String roleName) throws RBACException, IOException Exports theCustomForm
with the given id- Parameters:
oRes
-roleName
-- Throws:
RBACException
CustomFormException
IOException
-
importRole
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'rbac(role)\', \'C\')") public void importRole(org.springframework.web.multipart.MultipartFile inputFile, String newRoleName) throws IOException, RBACException, RoleCreationException Imports a new role in the current project- Parameters:
newRoleName
- name of the new role that will be created- Throws:
IOException
RBACException
RoleCreationException
-
cloneRole
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'rbac(role)\', \'CR\')") public void cloneRole(String sourceRoleName, String targetRoleName) throws RoleCreationException, RBACException This service allows to create a role by cloning an existing one. Since a role can be created just at project level, this service should be called only when a project is open.- Parameters:
sourceRoleName
-targetRoleName
-- Throws:
RBACException
RoleCreationException
-
addCapabilityToRole
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'rbac(role, capability)\', \'C\')") public void addCapabilityToRole(String role, String capability) throws RBACException - Parameters:
role
-capability
-- Throws:
RBACException
-
removeCapabilityFromRole
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'rbac(role, capability)\', \'D\')") public void removeCapabilityFromRole(String role, String capability) throws RBACException - Parameters:
role
-capability
-- Throws:
RBACException
-
updateCapabilityForRole
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'rbac(role, capability)\', \'U\')") public void updateCapabilityForRole(String role, String oldCapability, String newCapability) throws RBACException - Parameters:
role
-oldCapability
-newCapability
-- Throws:
RBACException
-
downloadPrivacyStatement
@STServiceOperation public void downloadPrivacyStatement(jakarta.servlet.http.HttpServletResponse oRes) throws IOException - Throws:
IOException
-
clonePUBinding
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void clonePUBinding(org.eclipse.rdf4j.model.IRI sourceUserIri, String sourceProjectName, @Optional org.eclipse.rdf4j.model.IRI targetUserIri, String targetProjectName) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, ProjectBindingException, UserException
-