diff --git a/roda-common/roda-common-data/src/main/java/org/roda/core/data/common/RodaConstants.java b/roda-common/roda-common-data/src/main/java/org/roda/core/data/common/RodaConstants.java index abb38ce965..bc399e470d 100644 --- a/roda-common/roda-common-data/src/main/java/org/roda/core/data/common/RodaConstants.java +++ b/roda-common/roda-common-data/src/main/java/org/roda/core/data/common/RodaConstants.java @@ -337,7 +337,6 @@ public enum DateGranularity { public static final String API_REST_V1_DIPFILES = "api/v1/dipfiles/"; public static final String API_REST_V1_DISTRIBUTED_INSTANCE = "api/v1/distributed_instances/"; - public static final String API_REST_V1_REPRESENTATION_OTHER_METADATA = "otherMetadata"; /** @@ -2016,110 +2015,104 @@ public enum RODA_TYPE { RodaConstants.DIPFILE_ID, RodaConstants.DIPFILE_PATH, RodaConstants.DIPFILE_DIP_ID, RodaConstants.DIPFILE_IS_DIRECTORY); - public static final String PERMISSION_METHOD_FIND_AIP = "org.roda.wui.api.controllers.Browser.find(IndexedAIP)"; - public static final String PERMISSION_METHOD_FIND_REPRESENTATION = "org.roda.wui.api.controllers.Browser.find(IndexedRepresentation)"; - public static final String PERMISSION_METHOD_FIND_FILE = "org.roda.wui.api.controllers.Browser.find(IndexedFile)"; - public static final String PERMISSION_METHOD_FIND_DIP = "org.roda.wui.api.controllers.Browser.find(IndexedDIP)"; - public static final String PERMISSION_METHOD_FIND_TRANSFERRED_RESOURCE = "org.roda.wui.api.controllers.Browser.find(TransferredResource)"; - public static final String PERMISSION_METHOD_FIND_RODA_MEMBER = "org.roda.wui.api.controllers.Browser.find(RodaMember)"; - public static final String PERMISSION_METHOD_FIND_DISPOSAL_CONFIRMATION = "org.roda.wui.api.controllers.Browser.find(DisposalConfirmation)"; - public static final String PERMISSION_METHOD_FIND_JOB_REPORT = "org.roda.wui.api.controllers.Browser.find(IndexedReport)"; - public static final String PERMISSION_METHOD_FIND_JOB = "org.roda.wui.api.controllers.Browser.find(Job)"; - public static final String PERMISSION_METHOD_FIND_NOTIFICATION = "org.roda.wui.api.controllers.Browser.find(Notification)"; - public static final String PERMISSION_METHOD_FIND_RISK_INCIDENCE = "org.roda.wui.api.controllers.Browser.find(RiskIncidence)"; - public static final String PERMISSION_METHOD_FIND_PRESERVATION_EVENT = "org.roda.wui.api.controllers.Browser.find(IndexedPreservationEvent)"; - public static final String PERMISSION_METHOD_FIND_PRESERVATION_AGENT = "org.roda.wui.api.controllers.Browser.find(IndexedPreservationAgent)"; - public static final String PERMISSION_METHOD_FIND_LOG_ENTRY = "org.roda.wui.api.controllers.Browser.find(LogEntry)"; - public static final String PERMISSION_METHOD_FIND_REPRESENTATION_INFORMATION = "org.roda.wui.api.controllers.Browser.find(RepresentationInformation)"; - public static final String PERMISSION_METHOD_FIND_RISK = "org.roda.wui.api.controllers.Browser.find(IndexedRisk)"; - - public static final String PERMISSION_METHOD_DELETE_AIP = "org.roda.wui.api.controllers.Browser.delete(IndexedAIP)"; - public static final String PERMISSION_METHOD_DELETE_DIP = "org.roda.wui.api.controllers.Browser.delete(IndexedDIP)"; - public static final String PERMISSION_METHOD_DELETE_REPRESENTATION = "org.roda.wui.api.controllers.Browser.delete(IndexedRepresentation)"; - public static final String PERMISSION_METHOD_DELETE_FILE = "org.roda.wui.api.controllers.Browser.delete(IndexedFile)"; - public static final String PERMISSION_METHOD_DELETE_REPRESENTATION_INFORMATION = "org.roda.wui.api.controllers.Browser.delete(RepresentationInformation)"; - public static final String PERMISSION_METHOD_DELETE_RISK = "org.roda.wui.api.controllers.Browser.delete(IndexedRisk)"; - public static final String PERMISSION_METHOD_DELETE_RISK_INCIDENCE = "org.roda.wui.api.controllers.Browser.delete(RiskIncidence)"; - public static final String PERMISSION_METHOD_DELETE_TRANSFERRED_RESOURCE = "org.roda.wui.api.controllers.Browser.delete(TransferredResource)"; - - public static final String PERMISSION_METHOD_RETRIEVE_AIP = "org.roda.wui.api.controllers.Browser.retrieve(IndexedAIP)"; - public static final String PERMISSION_METHOD_RETRIEVE_REPRESENTATION = "org.roda.wui.api.controllers.Browser.retrieve(IndexedRepresentation)"; - public static final String PERMISSION_METHOD_RETRIEVE_FILE = "org.roda.wui.api.controllers.Browser.retrieve(IndexedFile)"; - - public static final String PERMISSION_METHOD_LIST_AIP_DESCRIPTIVE_METADATA = "org.roda.wui.api.controllers.Browser.listAIPDescriptiveMetadata"; - public static final String PERMISSION_METHOD_LIST_REPRESENTATION_DESCRIPTIVE_METADATA = "org.roda.wui.api.controllers.Browser.listRepresentationDescriptiveMetadata"; - public static final String PERMISSION_METHOD_CREATE_AIP_BELOW = "org.roda.wui.api.controllers.Browser.createAIPBelow"; - public static final String PERMISSION_METHOD_CREATE_AIP_TOP = "org.roda.wui.api.controllers.Browser.createAIPTop"; - public static final String PERMISSION_METHOD_CREATE_REPRESENTATION = "org.roda.wui.api.controllers.Browser.createRepresentation"; - public static final String PERMISSION_METHOD_MOVE_AIP_IN_HIERARCHY = "org.roda.wui.api.controllers.Browser.moveAIPInHierarchy"; - public static final String PERMISSION_METHOD_UPDATE_AIP_PERMISSIONS = "org.roda.wui.api.controllers.Browser.updateAIPPermissions"; - public static final String PERMISSION_METHOD_UPDATE_DIP_PERMISSIONS = "org.roda.wui.api.controllers.Browser.updateDIPPermissions"; - public static final String PERMISSION_METHOD_CREATE_JOB = "org.roda.wui.api.controllers.Jobs.createJob"; - public static final String PERMISSION_METHOD_APPRAISAL = "org.roda.wui.api.controllers.Browser.appraisal"; - public static final String PERMISSION_METHOD_CHANGE_AIP_TYPE = "org.roda.wui.api.controllers.Browser.changeAIPType"; - public static final String PERMISSION_METHOD_CHANGE_REPRESENTATION_TYPE = "org.roda.wui.api.controllers.Browser.changeRepresentationType"; - public static final String PERMISSION_METHOD_RENAME_FOLDER = "org.roda.wui.api.controllers.Browser.renameFolder"; - public static final String PERMISSION_METHOD_MOVE_FILES = "org.roda.wui.api.controllers.Browser.moveFiles"; - public static final String PERMISSION_METHOD_CREATE_FILE = "org.roda.wui.api.controllers.Browser.createFile"; - public static final String PERMISSION_METHOD_CHANGE_REPRESENTATION_STATES = "org.roda.wui.api.controllers.Browser.changeRepresentationStates"; - public static final String PERMISSION_METHOD_CREATE_FOLDER = "org.roda.wui.api.controllers.Browser.createFolder"; - public static final String PERMISSION_METHOD_CREATE_REPRESENTATION_INFORMATION = "org.roda.wui.api.controllers.Browser.createRepresentationInformation"; - public static final String PERMISSION_METHOD_UPDATE_REPRESENTATION_INFORMATION = "org.roda.wui.api.controllers.Browser.updateRepresentationInformation"; - public static final String PERMISSION_METHOD_CREATE_RISK = "org.roda.wui.api.controllers.Risks.createRisk"; - public static final String PERMISSION_METHOD_UPDATE_RISK = "org.roda.wui.api.controllers.Browser.updateRisk"; - public static final String PERMISSION_METHOD_RETRIEVE_RISK_VERSIONS = "org.roda.wui.api.controllers.Browser.retrieveRiskVersions"; - public static final String PERMISSION_METHOD_UPDATE_RISK_INCIDENCE = "org.roda.wui.api.controllers.Browser.updateRiskIncidence"; - public static final String PERMISSION_METHOD_RENAME_TRANSFERRED_RESOURCE = "org.roda.wui.api.controllers.Browser.renameTransferredResource"; - public static final String PERMISSION_METHOD_MOVE_TRANSFERRED_RESOURCE = "org.roda.wui.api.controllers.Browser.moveTransferredResource"; - public static final String PERMISSION_METHOD_CREATE_TRANSFERRED_RESOURCE_FILE = "org.roda.wui.api.controllers.Browser.createTransferredResourceFile"; - public static final String PERMISSION_METHOD_CREATE_TRANSFERRED_RESOURCE_FOLDER = "org.roda.wui.api.controllers.Browser.createTransferredResourcesFolder"; - public static final String PERMISSION_METHOD_REVERT_DESCRIPTIVE_METADATA_VERSION = "org.roda.wui.api.controllers.Browser.revertDescriptiveMetadataVersion"; - public static final String PERMISSION_METHOD_DELETE_DESCRIPTIVE_METADATA_VERSION = "org.roda.wui.api.controllers.Browser.deleteDescriptiveMetadataVersion"; - public static final String PERMISSION_METHOD_CREATE_DESCRIPTIVE_METADATA_FILE = "org.roda.wui.api.controllers.Browser.createDescriptiveMetadataFile"; - public static final String PERMISSION_METHOD_UPDATE_DESCRIPTIVE_METADATA_FILE = "org.roda.wui.api.controllers.Browser.updateDescriptiveMetadataFile"; - public static final String PERMISSION_METHOD_DELETE_DESCRIPTIVE_METADATA_FILE = "org.roda.wui.api.controllers.Browser.deleteDescriptiveMetadataFile"; - public static final String PERMISSION_METHOD_RETRIEVE_DESCRIPTIVE_METADATA_VERSIONS_BUNDLE = "org.roda.wui.api.controllers.Browser.retrieveDescriptiveMetadataVersionsBundle"; - public static final String PERMISSION_METHOD_LIST_USERS = "org.roda.wui.api.controllers.Browser.findAll(RODAMember)"; - - public static final String PERMISSION_METHOD_CREATE_USER = "org.roda.wui.api.controllers.UserManagement.createUser"; - public static final String PERMISSION_METHOD_CREATE_GROUP = "org.roda.wui.api.controllers.UserManagement.createGroup"; - public static final String PERMISSION_METHOD_UPDATE_USER = "org.roda.wui.api.controllers.UserManagement.updateUser"; - public static final String PERMISSION_METHOD_DELETE_USER = "org.roda.wui.api.controllers.UserManagement.deleteUser"; - - public static final String PERMISSION_METHOD_CREATE_ACCESS_KEY = "org.roda.wui.api.controllers.ApplicationAuth.createAccessKey"; - - public static final String PERMISSION_METHOD_CREATE_DISPOSAL_RULE = "org.roda.wui.api.controllers.Disposals.createDisposalRule"; - public static final String PERMISSION_METHOD_UPDATE_DISPOSAL_RULE = "org.roda.wui.api.controllers.Disposals.updateDisposalRule"; - public static final String PERMISSION_METHOD_DELETE_DISPOSAL_RULE = "org.roda.wui.api.controllers.Disposals.deleteDisposalRule"; - - public static final String PERMISSION_METHOD_UPDATE_DISPOSAL_RULES = "org.roda.wui.api.controllers.Disposals.updateDisposalRules"; - - public static final String PERMISSION_METHOD_CREATE_DISPOSAL_SCHEDULE = "org.roda.wui.api.controllers.Disposals.createDisposalSchedule"; - public static final String PERMISSION_METHOD_UPDATE_DISPOSAL_SCHEDULE = "org.roda.wui.api.controllers.Disposals.updateDisposalSchedule"; - public static final String PERMISSION_METHOD_DELETE_DISPOSAL_SCHEDULE = "org.roda.wui.api.controllers.Disposals.deleteDisposalSchedule"; - public static final String PERMISSION_METHOD_ASSOCIATE_DISPOSAL_SCHEDULE = "org.roda.wui.api.controllers.Disposals.associateDisposalSchedule"; - - public static final String PERMISSION_METHOD_CREATE_DISPOSAL_HOLD = "org.roda.wui.api.controllers.Disposals.createDisposalHold"; - public static final String PERMISSION_METHOD_DELETE_DISPOSAL_HOLD = "org.roda.wui.api.controllers.Disposals.deleteDisposalHold"; - public static final String PERMISSION_METHOD_UPDATE_DISPOSAL_HOLD = "org.roda.wui.api.controllers.Disposals.updateDisposalHold"; - public static final String PERMISSION_METHOD_ASSOCIATE_DISPOSAL_HOLD = "org.roda.wui.api.controllers.Disposals.applyDisposalHold"; - - public static final String PERMISSION_METHOD_CREATE_DISPOSAL_CONFIRMATION = "org.roda.wui.api.controllers.Disposals.createDisposalConfirmation"; - public static final String PERMISSION_METHOD_DELETE_DISPOSAL_CONFIRMATION = "org.roda.wui.api.controllers.Disposals.deleteDisposalConfirmation"; - public static final String PERMISSION_METHOD_DESTROY_RECORDS_DISPOSAL_CONFIRMATION = "org.roda.wui.api.controllers.Disposals.destroyRecordsInDisposalConfirmationReport"; - public static final String PERMISSION_METHOD_RESTORE_RECORDS_DISPOSAL_CONFIRMATION = "org.roda.wui.api.controllers.Disposals.restoreRecordsInDisposalConfirmationReport"; - public static final String PERMISSION_METHOD_PERMANENTLY_DELETE_RECORDS_DISPOSAL_CONFIRMATION = "org.roda.wui.api.controllers.Disposals.permanentlyDeleteRecordsInDisposalConfirmationReport"; - public static final String PERMISSION_METHOD_RETRIEVE_DISPOSAL_CONFIRMATION_REPORT = "org.roda.wui.api.controllers.Disposals.retrieveDisposalConfirmationReport"; - - public static final String PERMISSION_METHOD_LIST_DISPOSAL_RULES = "org.roda.wui.api.controllers.Browser.listDisposalRules"; - public static final String PERMISSION_METHOD_LIST_DISPOSAL_SCHEDULES = "org.roda.wui.api.controllers.Browser.listDisposalSchedules"; - public static final String PERMISSION_METHOD_LIST_DISPOSAL_HOLDS = "org.roda.wui.api.controllers.Browser.listDisposalHolds"; - - public static final String PERMISSION_METHOD_STOP_JOB = "org.roda.wui.api.controllers.Jobs.stopJob"; - - public static final String PERMISSION_METHOD_APPROVE_JOB = "org.roda.wui.api.controllers.Jobs.approveJob"; - - public static final String PERMISSION_METHOD_REJECT_JOB = "org.roda.wui.api.controllers.Jobs.rejectJob"; + public static final String PERMISSION_METHOD_FIND_AIP = "org.roda.wui.api.v2.services.IndexService.find(IndexedAIP)"; + public static final String PERMISSION_METHOD_FIND_REPRESENTATION = "org.roda.wui.api.v2.services.IndexService.find(IndexedRepresentation)"; + public static final String PERMISSION_METHOD_FIND_FILE = "org.roda.wui.api.v2.services.IndexService.find(IndexedFile)"; + public static final String PERMISSION_METHOD_FIND_DIP = "org.roda.wui.api.v2.services.IndexService.find(IndexedDIP)"; + public static final String PERMISSION_METHOD_FIND_TRANSFERRED_RESOURCE = "org.roda.wui.api.v2.services.IndexService.find(TransferredResource)"; + public static final String PERMISSION_METHOD_FIND_RODA_MEMBER = "org.roda.wui.api.v2.services.IndexService.find(RODAMember)"; + public static final String PERMISSION_METHOD_FIND_JOB_REPORT = "org.roda.wui.api.v2.services.IndexService.find(IndexedReport)"; + public static final String PERMISSION_METHOD_FIND_JOB = "org.roda.wui.api.v2.services.IndexService.find(Job)"; + public static final String PERMISSION_METHOD_FIND_NOTIFICATION = "org.roda.wui.api.v2.services.IndexService.find(Notification)"; + public static final String PERMISSION_METHOD_FIND_RISK_INCIDENCE = "org.roda.wui.api.v2.services.IndexService.find(RiskIncidence)"; + public static final String PERMISSION_METHOD_FIND_PRESERVATION_EVENT = "org.roda.wui.api.v2.services.IndexService.find(IndexedPreservationEvent)"; + public static final String PERMISSION_METHOD_FIND_PRESERVATION_AGENT = "org.roda.wui.api.v2.services.IndexService.find(IndexedPreservationAgent)"; + public static final String PERMISSION_METHOD_FIND_LOG_ENTRY = "org.roda.wui.api.v2.services.IndexService.find(LogEntry)"; + public static final String PERMISSION_METHOD_FIND_REPRESENTATION_INFORMATION = "org.roda.wui.api.v2.services.IndexService.find(RepresentationInformation)"; + public static final String PERMISSION_METHOD_FIND_RISK = "org.roda.wui.api.v2.services.IndexService.find(IndexedRisk)"; + + public static final String PERMISSION_METHOD_DELETE_AIP = "org.roda.wui.api.v2.controller.AIPController.deleteAIPs"; + public static final String PERMISSION_METHOD_DELETE_DIP = "org.roda.wui.api.v2.controller.DIPController.deleteIndexedDIPs"; + public static final String PERMISSION_METHOD_DELETE_REPRESENTATION = "org.roda.wui.api.v2.controller.RepresentationController.deleteRepresentation"; + public static final String PERMISSION_METHOD_DELETE_FILE = "org.roda.wui.api.v2.controller.FilesController.deleteFiles"; + public static final String PERMISSION_METHOD_DELETE_REPRESENTATION_INFORMATION = "org.roda.wui.api.v2.controller.RepresentationInformationController.deleteMultipleRepresentationInformation"; + public static final String PERMISSION_METHOD_DELETE_RISK = "org.roda.wui.api.v2.controller.RiskController.deleteRisk"; + public static final String PERMISSION_METHOD_DELETE_RISK_INCIDENCE = "org.roda.wui.api.v2.controller.RiskIncidenceController.deleteRiskIncidences"; + public static final String PERMISSION_METHOD_DELETE_TRANSFERRED_RESOURCE = "org.roda.wui.api.v2.controller.TransferredResourceController.deleteMultipleResources"; + + public static final String PERMISSION_METHOD_LIST_AIP_DESCRIPTIVE_METADATA = "org.roda.wui.api.v2.controller.AIPController.retrieveRepresentationSupportedMetadata"; + + public static final String PERMISSION_METHOD_CREATE_AIP_BELOW = "org.roda.wui.api.v2.controller.AIPController.createAIPBelow"; + public static final String PERMISSION_METHOD_CREATE_AIP_TOP = "org.roda.wui.api.v2.controller.AIPController.createAIPTop"; + public static final String PERMISSION_METHOD_CREATE_REPRESENTATION = "org.roda.wui.api.v2.controller.RepresentationController.createRepresentation"; + public static final String PERMISSION_METHOD_MOVE_AIP_IN_HIERARCHY = "org.roda.wui.api.v2.controller.AIPController.moveAIPInHierarchy"; + public static final String PERMISSION_METHOD_UPDATE_AIP_PERMISSIONS = "org.roda.wui.api.v2.controller.AIPController.updatePermissions"; + public static final String PERMISSION_METHOD_UPDATE_DIP_PERMISSIONS = "org.roda.wui.api.v2.controller.DIPController.updatePermissions"; + public static final String PERMISSION_METHOD_CREATE_JOB = "org.roda.wui.api.v2.controller.JobsController.createJob"; + public static final String PERMISSION_METHOD_APPRAISAL = "org.roda.wui.api.v2.controller.AIPController.appraisal"; + public static final String PERMISSION_METHOD_CHANGE_AIP_TYPE = "org.roda.wui.api.v2.controller.AIPController.changeAIPType"; + public static final String PERMISSION_METHOD_CHANGE_REPRESENTATION_TYPE = "org.roda.wui.api.v2.controller.RepresentationController.changeRepresentationType"; + public static final String PERMISSION_METHOD_RENAME_FOLDER = "org.roda.wui.api.v2.controller.FilesController.renameFolder"; + public static final String PERMISSION_METHOD_MOVE_FILES = "org.roda.wui.api.v2.controller.FilesController.moveFileToFolder"; + public static final String PERMISSION_METHOD_CREATE_FILE = "org.roda.wui.api.v2.controller.FilesController.uploadFileResource"; + public static final String PERMISSION_METHOD_CHANGE_REPRESENTATION_STATES = "org.roda.wui.api.v2.controller.RepresentationController.changeRepresentationStatus"; + public static final String PERMISSION_METHOD_CREATE_FOLDER = "org.roda.wui.api.v2.controller.FilesController.createFolderUnderRepresentation"; + public static final String PERMISSION_METHOD_CREATE_REPRESENTATION_INFORMATION = "org.roda.wui.api.v2.controller.RepresentationInformationController.createRepresentationInformation"; + public static final String PERMISSION_METHOD_UPDATE_REPRESENTATION_INFORMATION = "org.roda.wui.api.v2.controller.RepresentationInformationController.updateRepresentationInformation"; + public static final String PERMISSION_METHOD_CREATE_RISK = "org.roda.wui.api.v2.controller.RiskController.createRisk"; + public static final String PERMISSION_METHOD_UPDATE_RISK = "org.roda.wui.api.v2.controller.RiskController.updateRisk"; + public static final String PERMISSION_METHOD_RETRIEVE_RISK_VERSIONS = "org.roda.wui.api.v2.controller.RiskController.retrieveRiskVersions"; + public static final String PERMISSION_METHOD_UPDATE_RISK_INCIDENCE = "org.roda.wui.api.v2.controller.RiskIncidenceController.updateRiskIncidence"; + public static final String PERMISSION_METHOD_RENAME_TRANSFERRED_RESOURCE = "org.roda.wui.api.v2.controller.TransferredResourceController.renameTransferredResource"; + public static final String PERMISSION_METHOD_MOVE_TRANSFERRED_RESOURCE = "org.roda.wui.api.v2.controller.TransferredResourceController.moveTransferredResources"; + public static final String PERMISSION_METHOD_CREATE_TRANSFERRED_RESOURCE_FILE = "org.roda.wui.api.v2.controller.TransferredResourceController.createTransferredResource"; + public static final String PERMISSION_METHOD_CREATE_TRANSFERRED_RESOURCE_FOLDER = "org.roda.wui.api.v2.controller.TransferredResourceController.createTransferredResourcesFolder"; + public static final String PERMISSION_METHOD_REVERT_DESCRIPTIVE_METADATA_VERSION = "org.roda.wui.api.v2.controller.AIPController.revertDescriptiveMetadataVersion"; + public static final String PERMISSION_METHOD_DELETE_DESCRIPTIVE_METADATA_VERSION = "org.roda.wui.api.v2.controller.AIPController.deleteDescriptiveMetadataVersion"; + public static final String PERMISSION_METHOD_CREATE_DESCRIPTIVE_METADATA_FILE = "org.roda.wui.api.v2.controller.AIPController.createDescriptiveMetadataFile"; + public static final String PERMISSION_METHOD_UPDATE_AIP_DESCRIPTIVE_METADATA_FILE = "org.roda.wui.api.v2.controller.AIPController.updateAIPDescriptiveMetadataFile"; + + public static final String PERMISSION_METHOD_UPDATE_REPRESENTATION_DESCRIPTIVE_METADATA_FILE = "org.roda.wui.api.v2.controller.AIPController.updateRepresentationDescriptiveMetadataFile"; + public static final String PERMISSION_METHOD_DELETE_DESCRIPTIVE_METADATA_FILE = "org.roda.wui.api.v2.controller.AIPController.deleteDescriptiveMetadataFile"; + public static final String PERMISSION_METHOD_RETRIEVE_AIP_DESCRIPTIVE_METADATA_VERSIONS = "org.roda.wui.api.v2.controller.AIPController.retrieveDescriptiveMetadataVersions"; + public static final String PERMISSION_METHOD_RETRIEVE_REPRESENTATION_DESCRIPTIVE_METADATA_VERSIONS = "org.roda.wui.api.v2.controller.AIPController.retrieveRepresentationDescriptiveMetadataVersions"; + public static final String PERMISSION_METHOD_LIST_USERS = "org.roda.wui.api.v2.services.IndexService.find(RODAMember)"; + + public static final String PERMISSION_METHOD_CREATE_USER = "org.roda.wui.api.v2.controller.MembersController.createUser"; + public static final String PERMISSION_METHOD_CREATE_GROUP = "org.roda.wui.api.v2.controller.MembersController.createGroup"; + public static final String PERMISSION_METHOD_UPDATE_USER = "org.roda.wui.api.v2.controller.MembersController.updateUser"; + public static final String PERMISSION_METHOD_DELETE_USER = "org.roda.wui.api.v2.controller.MembersController.deleteUser"; + + public static final String PERMISSION_METHOD_CREATE_ACCESS_KEY = "org.roda.wui.api.v2.controller.MembersController.createAccessKey"; + + public static final String PERMISSION_METHOD_CREATE_DISPOSAL_RULE = "org.roda.wui.api.v2.controller.DisposalRuleController.createDisposalRule"; + public static final String PERMISSION_METHOD_UPDATE_DISPOSAL_RULE = "org.roda.wui.api.v2.controller.DisposalRuleController.updateDisposalRule"; + + public static final String PERMISSION_METHOD_CREATE_DISPOSAL_SCHEDULE = "org.roda.wui.api.v2.controller.DisposalScheduleController.createDisposalSchedule"; + public static final String PERMISSION_METHOD_UPDATE_DISPOSAL_SCHEDULE = "org.roda.wui.api.v2.controller.DisposalScheduleController.updateDisposalSchedule"; + public static final String PERMISSION_METHOD_DELETE_DISPOSAL_SCHEDULE = "org.roda.wui.api.v2.controller.DisposalScheduleController.deleteDisposalSchedule"; + public static final String PERMISSION_METHOD_ASSOCIATE_DISPOSAL_SCHEDULE = "org.roda.wui.api.v2.controller.DisposalScheduleController.associatedDisposalSchedule"; + + public static final String PERMISSION_METHOD_CREATE_DISPOSAL_HOLD = "org.roda.wui.api.v2.controller.DisposalHoldController.createDisposalHold"; + public static final String PERMISSION_METHOD_UPDATE_DISPOSAL_HOLD = "org.roda.wui.api.v2.controller.DisposalHoldController.updateDisposalHold"; + public static final String PERMISSION_METHOD_ASSOCIATE_DISPOSAL_HOLD = "org.roda.wui.api.v2.controller.DisposalHoldController.applyDisposalHold"; + + public static final String PERMISSION_METHOD_CREATE_DISPOSAL_CONFIRMATION = "org.roda.wui.api.v2.controller.DisposalConfirmationController.createDisposalConfirmation"; + public static final String PERMISSION_METHOD_DELETE_DISPOSAL_CONFIRMATION = "org.roda.wui.api.v2.controller.DisposalConfirmationController.deleteDisposalConfirmation"; + public static final String PERMISSION_METHOD_DESTROY_RECORDS_DISPOSAL_CONFIRMATION = "org.roda.wui.api.v2.controller.DisposalConfirmationController.destroyRecordsInDisposalConfirmation"; + public static final String PERMISSION_METHOD_RESTORE_RECORDS_DISPOSAL_CONFIRMATION = "oorg.roda.wui.api.v2.controller.DisposalConfirmationController.restoreDisposalConfirmation"; + public static final String PERMISSION_METHOD_PERMANENTLY_DELETE_RECORDS_DISPOSAL_CONFIRMATION = "org.roda.wui.api.v2.controller.DisposalConfirmationController.permanentlyDeleteRecordsInDisposalConfirmation"; + public static final String PERMISSION_METHOD_RETRIEVE_DISPOSAL_CONFIRMATION_REPORT = "org.roda.wui.api.v2.controller.DisposalConfirmationController.retrieveDisposalConfirmationReport"; + + public static final String PERMISSION_METHOD_LIST_DISPOSAL_RULES = "org.roda.wui.api.v2.controller.DisposalRuleController.listDisposalRules"; + public static final String PERMISSION_METHOD_LIST_DISPOSAL_SCHEDULES = "org.roda.wui.api.v2.controller.DisposalScheduleController.listDisposalSchedules"; + public static final String PERMISSION_METHOD_LIST_DISPOSAL_HOLDS = "org.roda.wui.api.v2.controller.DisposalHoldController.listDisposalHolds"; + + public static final String PERMISSION_METHOD_STOP_JOB = "org.roda.wui.api.v2.controller.JobsController.stopJob"; + + public static final String PERMISSION_METHOD_APPROVE_JOB = "org.roda.wui.api.v2.controller.JobsController.approveJob"; + + public static final String PERMISSION_METHOD_REJECT_JOB = "org.roda.wui.api.v2.controller.JobsController.rejectJob"; public static final String ENV_CONFIG_SYMBOLIC_LINKS_FORBIDDEN = "RODA_CONFIG_SYMBOLIC_LINKS_FORBIDDEN"; diff --git a/roda-core/roda-core-tests/src/main/java/org/roda/core/plugins/UserPermissionsPluginTest.java b/roda-core/roda-core-tests/src/main/java/org/roda/core/plugins/UserPermissionsPluginTest.java index 1fc7023f9b..f3d0618b17 100644 --- a/roda-core/roda-core-tests/src/main/java/org/roda/core/plugins/UserPermissionsPluginTest.java +++ b/roda-core/roda-core-tests/src/main/java/org/roda/core/plugins/UserPermissionsPluginTest.java @@ -126,7 +126,7 @@ public void testIfEventsAreIndexedAfterIngest() throws IOException, RODAExceptio Facets.NONE, user, false, Collections.emptyList()); Assert.assertFalse(aipsOnIndex.getResults().isEmpty(), "No AIP is indexed"); - IndexedAIP aip = aipsOnIndex.getResults().get(0); + IndexedAIP aip = aipsOnIndex.getResults().getFirst(); Filter eventFilter = new Filter(); eventFilter.add(new SimpleFilterParameter(RodaConstants.PRESERVATION_EVENT_AIP_ID, aip.getId())); IndexResult eventsOnIndex = index.find(IndexedPreservationEvent.class, eventFilter, diff --git a/roda-core/roda-core/src/main/resources/config/roda-permissions.properties b/roda-core/roda-core/src/main/resources/config/roda-permissions.properties index 5c454ca2bf..5df61e05cb 100644 --- a/roda-core/roda-core/src/main/resources/config/roda-permissions.properties +++ b/roda-core/roda-core/src/main/resources/config/roda-permissions.properties @@ -15,9 +15,11 @@ ################################################################################# # AIP permissions -core.permissions.org.roda.wui.api.v2.controller.AIPController.createAIP = CREATE +core.permissions.org.roda.wui.api.v2.controller.AIPController.createAIPBelow = CREATE +core.permissions.org.roda.wui.api.v2.controller.AIPController.createAIPTop = CREATE core.permissions.org.roda.wui.api.v2.controller.AIPController.moveAIPInHierarchy = UPDATE core.permissions.org.roda.wui.api.v2.controller.AIPController.changeAIPType = UPDATE +core.permissions.org.roda.wui.api.v2.controller.AIPController.updatePermissions = UPDATE core.permissions.org.roda.wui.api.v2.controller.AIPController.appraisal = UPDATE core.permissions.org.roda.wui.api.v2.controller.AIPController.downloadAIP = READ core.permissions.org.roda.wui.api.v2.controller.AIPController.retrieveAIPSupportedMetadata = READ diff --git a/roda-core/roda-core/src/main/resources/config/roda-roles.properties b/roda-core/roda-core/src/main/resources/config/roda-roles.properties index 5fcd22fd21..76e7597fa5 100644 --- a/roda-core/roda-core/src/main/resources/config/roda-roles.properties +++ b/roda-core/roda-core/src/main/resources/config/roda-roles.properties @@ -27,9 +27,11 @@ core.roles.org.roda.wui.api.v2.controller.AIPController.getDocumentation = aip.r core.roles.org.roda.wui.api.v2.controller.AIPController.getSubmissions = aip.read core.roles.org.roda.wui.api.v2.controller.AIPController.moveAIPInHierarchy = aip.update core.roles.org.roda.wui.api.v2.controller.AIPController.changeAIPType = aip.update +core.roles.org.roda.wui.api.v2.controller.AIPController.updatePermissions = aip.update core.roles.org.roda.wui.api.v2.controller.AIPController.appraisal = aip.appraisal core.roles.org.roda.wui.api.v2.controller.AIPController.downloadAIP = aip.read -core.roles.org.roda.wui.api.v2.controller.AIPController.createAIP = aip.create +core.roles.org.roda.wui.api.v2.controller.AIPController.createAIPTop = aip.create.top +core.roles.org.roda.wui.api.v2.controller.AIPController.createAIPBelow = aip.create.below core.roles.org.roda.wui.api.v2.controller.AIPController.retrieveDescriptiveMetadataPreview = aip.read core.roles.org.roda.wui.api.v2.controller.AIPController.retrieveSupportedMetadataTypes = aip.read core.roles.org.roda.wui.api.v2.controller.AIPController.retrieveAIPSupportedMetadata = aip.read @@ -70,6 +72,7 @@ core.roles.org.roda.wui.api.v2.controller.JobsController.getJobReport = job.mana core.roles.org.roda.wui.api.v2.controller.JobsController.findByUuid(Job) = job.read core.roles.org.roda.wui.api.v2.controller.JobsController.listJobReports = job.read core.roles.org.roda.wui.api.v2.controller.JobsController.rejectJob = job.manage +core.roles.org.roda.wui.api.v2.controller.JobsController.approveJob = job.manage core.roles.org.roda.wui.api.v2.controller.JobsController.stopJob = job.manage core.roles.org.roda.wui.api.v2.controller.JobsController.retrieveJobAttachment = job.read core.roles.org.roda.wui.api.v2.controller.JobsController.createJob = job.manage @@ -127,7 +130,6 @@ core.roles.org.roda.wui.api.v2.controller.DisposalHoldController.listDisposalHol core.roles.org.roda.wui.api.v2.controller.DisposalHoldController.updateDisposalHold = disposal_hold.manage core.roles.org.roda.wui.api.v2.controller.DisposalHoldController.createDisposalHold = disposal_hold.manage core.roles.org.roda.wui.api.v2.controller.DisposalHoldController.retrieveDisposalHold = disposal_hold.read -core.roles.org.roda.wui.api.v2.controller.DisposalRuleController.updateDisposalRule = disposal_hold.manage core.roles.org.roda.wui.api.v2.controller.DisposalHoldController.applyDisposalHold = disposal_hold.apply core.roles.org.roda.wui.api.v2.controller.DisposalHoldController.liftDisposalHold=disposal_hold.apply core.roles.org.roda.wui.api.v2.controller.DisposalHoldController.disassociateDisposalHold = disposal_hold.apply @@ -149,6 +151,7 @@ core.roles.org.roda.wui.api.v2.controller.DisposalRuleController.listDisposalRul core.roles.org.roda.wui.api.v2.controller.DisposalRuleController.createDisposalRule = disposal_rule.manage core.roles.org.roda.wui.api.v2.controller.DisposalRuleController.createDisposalRule(DisposalSchedule) = disposal_rule.manage core.roles.org.roda.wui.api.v2.controller.DisposalRuleController.retrieveDisposalRule = disposal_rule.read +core.roles.org.roda.wui.api.v2.controller.DisposalRuleController.updateDisposalRule = disposal_hold.manage core.roles.org.roda.wui.api.v2.controller.DisposalRuleController.deleteDisposalRule = disposal_rule.manage core.roles.org.roda.wui.api.v2.controller.DisposalRuleController.applyDisposalRules = disposal_schedule.associate @@ -322,10 +325,6 @@ core.roles.org.roda.wui.api.v2.services.IndexService.exportToCSV(IndexedDIP) = a core.roles.org.roda.wui.api.v2.services.IndexService.exportToCSV(RiskIncidence) = incidence.read # Old roles - deprecated - and soon to be deleted -core.roles.org.roda.wui.api.controllers.Browser.appraisal = aip.appraisal -core.roles.org.roda.wui.api.controllers.Browser.changeAIPType = aip.update -core.roles.org.roda.wui.api.controllers.Browser.changeRepresentationStates = representation.update -core.roles.org.roda.wui.api.controllers.Browser.changeRepresentationType = representation.update core.roles.org.roda.wui.api.controllers.Browser.updateRepresentationDescriptiveMetadataFile = representation.update core.roles.org.roda.wui.api.controllers.Browser.createRepresentationDescriptiveMetadataFile = representation.create core.roles.org.roda.wui.api.controllers.Browser.count(RepresentationInformation) = ri.read @@ -347,44 +346,25 @@ core.roles.org.roda.wui.api.controllers.Browser.count(RiskIncidence) = risk.read core.roles.org.roda.wui.api.controllers.Browser.count(TransferredResource) = transfer.read core.roles.org.roda.wui.api.controllers.Browser.count(IndexedDIP) = aip.read core.roles.org.roda.wui.api.controllers.Browser.count(DIPFile) = aip.read -core.roles.org.roda.wui.api.controllers.Browser.createAIPTop = aip.create.top -core.roles.org.roda.wui.api.controllers.Browser.createAIPBelow = aip.create.below core.roles.org.roda.wui.api.controllers.Browser.createAIPDescriptiveMetadataFile = aip.create core.roles.org.roda.wui.api.controllers.Browser.createDIP = aip.create core.roles.org.roda.wui.api.controllers.Browser.createDIPFile = aip.create core.roles.org.roda.wui.api.controllers.Browser.createDIPFolder = aip.create -core.roles.org.roda.wui.api.controllers.Browser.createDescriptiveMetadataFile = descriptive_metadata.create -core.roles.org.roda.wui.api.controllers.Browser.createFile = representation.create core.roles.org.roda.wui.api.controllers.Browser.createFileWithUUID = representation.create -core.roles.org.roda.wui.api.controllers.Browser.createRepresentationInformation = ri.manage core.roles.org.roda.wui.api.controllers.Browser.createOrUpdatePreservationMetadataWithAIP = preservation_metadata.create core.roles.org.roda.wui.api.controllers.Browser.createOrUpdatePreservationMetadataWithFile = preservation_metadata.create core.roles.org.roda.wui.api.controllers.Browser.createOrUpdatePreservationMetadataWithRepresentation = preservation_metadata.create -core.roles.org.roda.wui.api.controllers.Browser.createRepresentation = representation.create -core.roles.org.roda.wui.api.controllers.Browser.createRisk = risk.manage -core.roles.org.roda.wui.api.controllers.Browser.createTransferredResourceFile = transfer.create -core.roles.org.roda.wui.api.controllers.Browser.createTransferredResourcesFolder = transfer.create -core.roles.org.roda.wui.api.controllers.Browser.delete(RepresentationInformation) = ri.manage core.roles.org.roda.wui.api.controllers.Browser.delete(RODAMember) = member.manage -core.roles.org.roda.wui.api.controllers.Browser.delete(IndexedAIP) = aip.delete -core.roles.org.roda.wui.api.controllers.Browser.delete(IndexedFile) = representation.delete core.roles.org.roda.wui.api.controllers.Browser.delete(IndexedPreservationAgent) = preservation_metadata.delete core.roles.org.roda.wui.api.controllers.Browser.delete(IndexedPreservationEvent) = preservation_metadata.delete -core.roles.org.roda.wui.api.controllers.Browser.delete(IndexedRepresentation) = representation.delete -core.roles.org.roda.wui.api.controllers.Browser.delete(IndexedRisk) = risk.manage core.roles.org.roda.wui.api.controllers.Browser.delete(Job) = job.manage core.roles.org.roda.wui.api.controllers.Browser.delete(LogEntry) = log_entry.delete core.roles.org.roda.wui.api.controllers.Browser.delete(Notification) = notification.manage core.roles.org.roda.wui.api.controllers.Browser.delete(IndexedReport) = job.manage -core.roles.org.roda.wui.api.controllers.Browser.delete(RiskIncidence) = risk.manage -core.roles.org.roda.wui.api.controllers.Browser.delete(TransferredResource) = transfer.delete -core.roles.org.roda.wui.api.controllers.Browser.delete(IndexedDIP) = aip.delete core.roles.org.roda.wui.api.controllers.Browser.delete(DIPFile) = aip.delete core.roles.org.roda.wui.api.controllers.Browser.deleteAIP = aip.delete core.roles.org.roda.wui.api.controllers.Browser.deleteDIPs = aip.delete core.roles.org.roda.wui.api.controllers.Browser.deleteDIPFile = aip.delete -core.roles.org.roda.wui.api.controllers.Browser.deleteDescriptiveMetadataFile = descriptive_metadata.delete -core.roles.org.roda.wui.api.controllers.Browser.deleteDescriptiveMetadataVersion = descriptive_metadata.delete core.roles.org.roda.wui.api.controllers.Browser.deleteFile = representation.delete core.roles.org.roda.wui.api.controllers.Browser.deleteRepresentationInformation = ri.manage core.roles.org.roda.wui.api.controllers.Browser.deletePreservationMetadataWithAIP = preservation_metadata.delete @@ -396,25 +376,8 @@ core.roles.org.roda.wui.api.controllers.Browser.deleteRiskIncidences = risk.mana core.roles.org.roda.wui.api.controllers.Browser.deleteRiskVersion = risk.manage core.roles.org.roda.wui.api.controllers.Browser.deleteTransferredResources = transfer.delete core.roles.org.roda.wui.api.controllers.Browser.reindexTransferredResource = transfer.create -core.roles.org.roda.wui.api.controllers.Browser.find(RepresentationInformation) = ri.read -core.roles.org.roda.wui.api.controllers.Browser.find(IndexedAIP) = aip.read -core.roles.org.roda.wui.api.controllers.Browser.find(IndexedFile) = representation.read -core.roles.org.roda.wui.api.controllers.Browser.find(IndexedPreservationAgent) = preservation_metadata.read -core.roles.org.roda.wui.api.controllers.Browser.find(IndexedPreservationEvent) = preservation_metadata.read -core.roles.org.roda.wui.api.controllers.Browser.find(IndexedRepresentation) = representation.read -core.roles.org.roda.wui.api.controllers.Browser.find(IndexedRisk) = risk.read -core.roles.org.roda.wui.api.controllers.Browser.find(Job) = job.read core.roles.org.roda.wui.api.controllers.Browser.find(Report) = job.read -core.roles.org.roda.wui.api.controllers.Browser.find(LogEntry) = log_entry.read -core.roles.org.roda.wui.api.controllers.Browser.find(Notification) = notification.read -core.roles.org.roda.wui.api.controllers.Browser.find(IndexedReport) = job.read -core.roles.org.roda.wui.api.controllers.Browser.find(RiskIncidence) = risk.read -core.roles.org.roda.wui.api.controllers.Browser.find(RODAMember) = member.read -core.roles.org.roda.wui.api.controllers.Browser.find(TransferredResource) = transfer.read -core.roles.org.roda.wui.api.controllers.Browser.find(IndexedDIP) = aip.view -core.roles.org.roda.wui.api.controllers.Browser.find(IndexedDIP) = aip.read core.roles.org.roda.wui.api.controllers.Browser.find(DIPFile) = aip.read -core.roles.org.roda.wui.api.controllers.Browser.find(DisposalConfirmation) = disposal_confirmation.read core.roles.org.roda.wui.api.controllers.Browser.findAll(RepresentationInformation) = ri.read core.roles.org.roda.wui.api.controllers.Browser.findAll(IndexedAIP) = aip.read core.roles.org.roda.wui.api.controllers.Browser.findAll(IndexedFile) = representation.read @@ -435,26 +398,16 @@ core.roles.org.roda.wui.api.controllers.Browser.hasDocumentation = aip.read core.roles.org.roda.wui.api.controllers.Browser.hasSubmissions = aip.read core.roles.org.roda.wui.api.controllers.Browser.hasRiskVersions = risk.read core.roles.org.roda.wui.api.controllers.Browser.lastReport = job.read -core.roles.org.roda.wui.api.controllers.Browser.listAIPDescriptiveMetadata = descriptive_metadata.read core.roles.org.roda.wui.api.controllers.Browser.listAIPPreservationMetadata = preservation_metadata.read core.roles.org.roda.wui.api.controllers.Browser.listReports = job.read core.roles.org.roda.wui.api.controllers.Browser.listRepresentationDescriptiveMetadata = descriptive_metadata.read -core.roles.org.roda.wui.api.controllers.Browser.moveAIPInHierarchy = aip.update -core.roles.org.roda.wui.api.controllers.Browser.moveTransferredResource = transfer.update core.roles.org.roda.wui.api.controllers.Browser.postAIPDescriptiveMetadataFile = descriptive_metadata.create core.roles.org.roda.wui.api.controllers.Browser.postAipRepresentationPreservationMetadataFile = preservation_metadata.create core.roles.org.roda.wui.api.controllers.Browser.putAIPDescriptiveMetadataFile = descriptive_metadata.update core.roles.org.roda.wui.api.controllers.Browser.putRepresentationDescriptiveMetadataFile = descriptive_metadata.update -core.roles.org.roda.wui.api.controllers.Browser.renameTransferredResource = transfer.update -core.roles.org.roda.wui.api.controllers.Browser.renameFolder = representation.update -core.roles.org.roda.wui.api.controllers.Browser.moveFiles = representation.update -core.roles.org.roda.wui.api.controllers.Browser.createFolder = representation.update core.roles.org.roda.wui.api.controllers.Browser.retrieve(RepresentationInformation) = ri.read -core.roles.org.roda.wui.api.controllers.Browser.retrieve(IndexedAIP) = aip.read -core.roles.org.roda.wui.api.controllers.Browser.retrieve(IndexedFile) = representation.read core.roles.org.roda.wui.api.controllers.Browser.retrieve(IndexedPreservationAgent) = preservation_metadata.read core.roles.org.roda.wui.api.controllers.Browser.retrieve(IndexedPreservationEvent) = preservation_metadata.read -core.roles.org.roda.wui.api.controllers.Browser.retrieve(IndexedRepresentation) = representation.read core.roles.org.roda.wui.api.controllers.Browser.retrieve(Risk) = risk.read core.roles.org.roda.wui.api.controllers.Browser.retrieve(IndexedRisk) = risk.read core.roles.org.roda.wui.api.controllers.Browser.retrieve(Job) = job.read @@ -494,7 +447,6 @@ core.roles.org.roda.wui.api.controllers.Browser.retrieveClassificationPlan = aip core.roles.org.roda.wui.api.controllers.Browser.retrieveDescriptiveMetadataEditBundle = descriptive_metadata.update core.roles.org.roda.wui.api.controllers.Browser.retrieveDescriptiveMetadataFile = descriptive_metadata.read core.roles.org.roda.wui.api.controllers.Browser.retrieveDescriptiveMetadataPreview = descriptive_metadata.read -core.roles.org.roda.wui.api.controllers.Browser.retrieveDescriptiveMetadataVersionsBundle = descriptive_metadata.read core.roles.org.roda.wui.api.controllers.Browser.retrieveDIP = aip.read core.roles.org.roda.wui.api.controllers.Browser.retrieveFileById = representation.read core.roles.org.roda.wui.api.controllers.Browser.retrieveFilePreservationMetadata = preservation_metadata.read @@ -509,14 +461,12 @@ core.roles.org.roda.wui.api.controllers.Browser.retrievePreservationEventViewBun core.roles.org.roda.wui.api.controllers.Browser.retrieveRepresentationById = representation.read core.roles.org.roda.wui.api.controllers.Browser.retrieveRepresentationDescriptiveMetadata = descriptive_metadata.read core.roles.org.roda.wui.api.controllers.Browser.retrieveRiskVersion = risk.read -core.roles.org.roda.wui.api.controllers.Browser.retrieveRiskVersions = risk.read core.roles.org.roda.wui.api.controllers.Browser.retrieveScanUpdateStatus = transfer.read core.roles.org.roda.wui.api.controllers.Browser.retrieveSelectedTransferredResource = transfer.read core.roles.org.roda.wui.api.controllers.Browser.retrieveShowMitigationTerms = risk.read core.roles.org.roda.wui.api.controllers.Browser.retrieveSupportedMetadata = descriptive_metadata.read core.roles.org.roda.wui.api.controllers.Browser.retrieveTransferredResource = transfer.read core.roles.org.roda.wui.api.controllers.Browser.retrieveTransferredResourceBinary = transfer.read -core.roles.org.roda.wui.api.controllers.Browser.revertDescriptiveMetadataVersion = descriptive_metadata.update core.roles.org.roda.wui.api.controllers.Browser.revertRiskVersion = risk.manage core.roles.org.roda.wui.api.controllers.Browser.suggest(RepresentationInformation) = ri.read core.roles.org.roda.wui.api.controllers.Browser.suggest(IndexedAIP) = aip.read @@ -538,17 +488,11 @@ core.roles.org.roda.wui.api.controllers.Browser.updateAIP = aip.update core.roles.org.roda.wui.api.controllers.Browser.updateAIPDescriptiveMetadataFile = aip.update core.roles.org.roda.wui.api.controllers.Browser.updateDIP = aip.update core.roles.org.roda.wui.api.controllers.Browser.updateDIPFile = aip.update -core.roles.org.roda.wui.api.controllers.Browser.updateAIPPermissions = aip.update -core.roles.org.roda.wui.api.controllers.Browser.updateDIPPermissions = aip.update core.roles.org.roda.wui.api.controllers.Browser.updateTransferredResources = transfer.read core.roles.org.roda.wui.api.controllers.Browser.updateTransferredResource = transfer.read -core.roles.org.roda.wui.api.controllers.Browser.updateDescriptiveMetadataFile = descriptive_metadata.update core.roles.org.roda.wui.api.controllers.Browser.updateFile = representation.update -core.roles.org.roda.wui.api.controllers.Browser.updateRepresentationInformation = ri.manage core.roles.org.roda.wui.api.controllers.Browser.updateRepresentation = representation.update -core.roles.org.roda.wui.api.controllers.Browser.updateRisk = risk.manage core.roles.org.roda.wui.api.controllers.Browser.updateRiskCounters = risk.read -core.roles.org.roda.wui.api.controllers.Browser.updateRiskIncidence = risk.manage core.roles.org.roda.wui.api.controllers.Browser.updateMultipleIncidences = risk.manage core.roles.org.roda.wui.api.controllers.Browser.createFormatIdentificationJob = representation.update core.roles.org.roda.wui.api.controllers.Browser.verifyPermissions = permission.read @@ -564,17 +508,11 @@ core.roles.org.roda.wui.api.controllers.Browser.retrieveRepresentationInformatio core.roles.org.roda.wui.api.controllers.Browser.retrieveRepresentationInformation = ri.read core.roles.org.roda.wui.api.controllers.Browser.importLogEntries = log_entry.create -core.roles.org.roda.wui.api.controllers.RepresentationInformations.createRepresentationInformation = ri.manage -core.roles.org.roda.wui.api.controllers.RepresentationInformations.updateRepresentationInformation = ri.manage core.roles.org.roda.wui.api.controllers.RepresentationInformations.deleteRepresentationInformation = ri.manage -core.roles.org.roda.wui.api.controllers.Jobs.createJob = job.manage core.roles.org.roda.wui.api.controllers.Jobs.createJobs = job.manage core.roles.org.roda.wui.api.controllers.Jobs.startJob = job.manage -core.roles.org.roda.wui.api.controllers.Jobs.stopJob = job.manage core.roles.org.roda.wui.api.controllers.Jobs.deleteJob = job.manage -core.roles.org.roda.wui.api.controllers.Jobs.approveJob = job.manage -core.roles.org.roda.wui.api.controllers.Jobs.rejectJob = job.manage core.roles.org.roda.wui.api.controllers.Jobs.retrieveJobAttachment = job.read core.roles.org.roda.wui.api.controllers.Jobs.retrieveJobReportItems = job.read @@ -583,20 +521,14 @@ core.roles.org.roda.wui.api.controllers.Metrics.getMetrics = job.manage core.roles.org.roda.wui.api.controllers.Notifications.createNotification = notification.manage core.roles.org.roda.wui.api.controllers.Notifications.updateNotification = notification.manage core.roles.org.roda.wui.api.controllers.Notifications.deleteNotification = notification.manage -core.roles.org.roda.wui.api.controllers.Risks.createRisk = risk.manage core.roles.org.roda.wui.api.controllers.Risks.createRiskIncidence = risk.manage -core.roles.org.roda.wui.api.controllers.Risks.updateRisk = risk.manage core.roles.org.roda.wui.api.controllers.Risks.deleteRisk = risk.manage -core.roles.org.roda.wui.api.controllers.Risks.updateRiskIncidence = risk.manage core.roles.org.roda.wui.api.controllers.Risks.deleteRiskIncidence = risk.manage core.roles.org.roda.wui.api.controllers.UserManagement.changeActiveMembers = member.manage core.roles.org.roda.wui.api.controllers.UserManagement.confirmUserEmail = -core.roles.org.roda.wui.api.controllers.UserManagement.createGroup = member.manage -core.roles.org.roda.wui.api.controllers.UserManagement.createUser = member.manage core.roles.org.roda.wui.api.controllers.UserManagement.deleteGroup = member.manage core.roles.org.roda.wui.api.controllers.UserManagement.deleteMembers = member.manage -core.roles.org.roda.wui.api.controllers.UserManagement.deleteUser = member.manage core.roles.org.roda.wui.api.controllers.UserManagement.listAllGroups = member.read core.roles.org.roda.wui.api.controllers.UserManagement.registerUser = core.roles.org.roda.wui.api.controllers.UserManagement.requestPasswordReset = @@ -610,46 +542,24 @@ core.roles.org.roda.wui.api.controllers.UserManagement.sendEmailVerification = core.roles.org.roda.wui.api.controllers.UserManagement.sendRecoverLoginEmail = core.roles.org.roda.wui.api.controllers.UserManagement.updateGroup = member.manage core.roles.org.roda.wui.api.controllers.UserManagement.updateMyUser = -core.roles.org.roda.wui.api.controllers.UserManagement.updateUser = member.manage core.roles.org.roda.wui.api.controllers.Browser.retrieveDisposalRule = disposal_rule.read -core.roles.org.roda.wui.api.controllers.Browser.listDisposalRules = disposal_rule.read -core.roles.org.roda.wui.api.controllers.Disposals.createDisposalRule = disposal_rule.manage -core.roles.org.roda.wui.api.controllers.Disposals.updateDisposalRule = disposal_rule.manage -core.roles.org.roda.wui.api.controllers.Disposals.updateDisposalRules = disposal_rule.manage -core.roles.org.roda.wui.api.controllers.Disposals.deleteDisposalRule = disposal_rule.manage core.roles.org.roda.wui.api.controllers.Browser.retrieveDisposalSchedule = disposal_schedule.read -core.roles.org.roda.wui.api.controllers.Browser.listDisposalSchedules = disposal_schedule.read -core.roles.org.roda.wui.api.controllers.Disposals.createDisposalSchedule = disposal_schedule.manage -core.roles.org.roda.wui.api.controllers.Disposals.updateDisposalSchedule = disposal_schedule.manage -core.roles.org.roda.wui.api.controllers.Disposals.deleteDisposalSchedule = disposal_schedule.manage -core.roles.org.roda.wui.api.controllers.Disposals.associateDisposalSchedule = disposal_schedule.associate core.roles.org.roda.wui.api.controllers.Disposals.disassociateDisposalSchedule = disposal_schedule.associate core.roles.org.roda.wui.api.controllers.Browser.retrieveDisposalHold = disposal_hold.read -core.roles.org.roda.wui.api.controllers.Browser.listDisposalHolds = disposal_hold.read core.roles.org.roda.wui.api.controllers.Browser.listDisposalHoldsAssociation = disposal_hold.read core.roles.org.roda.wui.api.controllers.Browser.listTransitiveDisposalHolds = disposal_hold.read -core.roles.org.roda.wui.api.controllers.Disposals.createDisposalHold = disposal_hold.manage -core.roles.org.roda.wui.api.controllers.Disposals.updateDisposalHold = disposal_hold.manage -core.roles.org.roda.wui.api.controllers.Disposals.deleteDisposalHold = disposal_hold.manage -core.roles.org.roda.wui.api.controllers.Disposals.applyDisposalHold = disposal_hold.apply core.roles.org.roda.wui.api.controllers.Disposals.liftDisposalHold = disposal_hold.apply core.roles.org.roda.wui.api.controllers.Disposals.disassociateDisposalHold = disposal_hold.apply -core.roles.org.roda.wui.api.controllers.Disposals.deleteDisposalConfirmation = disposal_confirmation.manage -core.roles.org.roda.wui.api.controllers.Disposals.createDisposalConfirmation = disposal_confirmation.manage core.roles.org.roda.wui.api.controllers.Disposals.retrieveDisposalConfirmationExtraBundle = disposal_confirmation.manage -core.roles.org.roda.wui.api.controllers.Disposals.destroyRecordsInDisposalConfirmationReport = disposal_confirmation.destroy core.roles.org.roda.wui.api.controllers.Disposals.recoverDisposalConfirmation = disposal_confirmation.destroy core.roles.org.roda.wui.api.controllers.Disposals.reExecuteDisposalConfirmationReport = disposal_confirmation.destroy -core.roles.org.roda.wui.api.controllers.Disposals.restoreRecordsInDisposalConfirmationReport = disposal_confirmation.restore -core.roles.org.roda.wui.api.controllers.Disposals.permanentlyDeleteRecordsInDisposalConfirmationReport = disposal_confirmation.delete_bin core.roles.org.roda.wui.api.controllers.Disposals.applyDisposalRules = disposal_schedule.associate -core.roles.org.roda.wui.api.controllers.Disposals.retrieveDisposalConfirmationReport = disposal_confirmation.manage core.roles.org.roda.wui.api.controllers.RODAInstance.createDistributedInstance = distributed_instances.manage core.roles.org.roda.wui.api.controllers.RODAInstance.listDistributedInstances = distributed_instances.read @@ -674,7 +584,6 @@ core.roles.org.roda.wui.api.controllers.RODAInstance.retrieveLocalInstanceStatus core.roles.org.roda.wui.api.controllers.RODAInstance.removeLocalConfiguration = localInstanceConfiguration.manage core.roles.org.roda.wui.api.controllers.ApplicationAuth.authenticate = access_key.read -core.roles.org.roda.wui.api.controllers.ApplicationAuth.createAccessKey = access_key.manage core.roles.org.roda.wui.api.controllers.ApplicationAuth.retrieveAccessKey = access_key.read core.roles.org.roda.wui.api.controllers.ApplicationAuth.listAccessKey = access_key.read core.roles.org.roda.wui.api.controllers.ApplicationAuth.updateAccessKey = access_key.manage diff --git a/roda-ui/roda-wui/src/main/java/org/roda/wui/api/v2/controller/AIPController.java b/roda-ui/roda-wui/src/main/java/org/roda/wui/api/v2/controller/AIPController.java index 85a0c62d77..330e913cd1 100644 --- a/roda-ui/roda-wui/src/main/java/org/roda/wui/api/v2/controller/AIPController.java +++ b/roda-ui/roda-wui/src/main/java/org/roda/wui/api/v2/controller/AIPController.java @@ -848,66 +848,81 @@ public SupportedMetadataValue retrieveRepresentationSupportedMetadata(String aip @Override public AIP createAIP(String parentId, String type) { + if (parentId == null) { + return createAIPTop(type); + } else { + return createAIPBelow(parentId, type); + } + } + + public AIP createAIPTop(String type) { final ControllerAssistant controllerAssistant = new ControllerAssistant() {}; RequestContext requestContext = RequestUtils.parseHTTPRequest(request); LogEntryState state = LogEntryState.SUCCESS; - if (parentId == null) { - try { - controllerAssistant.checkRoles(requestContext.getUser()); - Permissions permissions = new Permissions(); - - // delegate - return aipService.createAIP(requestContext.getUser(), null, type, permissions); - } catch (AlreadyExistsException | NotFoundException | RequestNotValidException | GenericException e) { - state = LogEntryState.FAILURE; - throw new RESTException(e); - } catch (AuthorizationDeniedException e) { - state = LogEntryState.UNAUTHORIZED; - throw new RESTException(e); - } finally { - // register action - controllerAssistant.registerAction(requestContext, state, RodaConstants.CONTROLLER_TYPE_PARAM, type); - } - } else { - try { - Permissions permissions = new Permissions(); + try { + controllerAssistant.checkRoles(requestContext.getUser()); + Permissions permissions = new Permissions(); - IndexedAIP parentSDO = indexService.retrieve(requestContext, IndexedAIP.class, parentId, - RodaConstants.AIP_PERMISSIONS_FIELDS_TO_RETURN); - controllerAssistant.checkObjectPermissions(requestContext.getUser(), parentSDO); + // delegate + return aipService.createAIP(requestContext.getUser(), null, type, permissions); + } catch (AlreadyExistsException | NotFoundException | RequestNotValidException | GenericException e) { + state = LogEntryState.FAILURE; + throw new RESTException(e); + } catch (AuthorizationDeniedException e) { + state = LogEntryState.UNAUTHORIZED; + throw new RESTException(e); + } finally { + // register action + controllerAssistant.registerAction(requestContext, state, RodaConstants.CONTROLLER_TYPE_PARAM, type); + } - // check state - controllerAssistant.checkAIPstate(parentSDO); + } - // check if AIP is in a disposal confirmation - controllerAssistant.checkIfAIPInConfirmation(parentSDO); + public AIP createAIPBelow(String parentId, String type) { - Permissions parentPermissions = parentSDO.getPermissions(); + final ControllerAssistant controllerAssistant = new ControllerAssistant() {}; + RequestContext requestContext = RequestUtils.parseHTTPRequest(request); + LogEntryState state = LogEntryState.SUCCESS; - for (String name : parentPermissions.getUsernames()) { - permissions.setUserPermissions(name, parentPermissions.getUserPermissions(name)); - } + try { + Permissions permissions = new Permissions(); - for (String name : parentPermissions.getGroupnames()) { - permissions.setGroupPermissions(name, parentPermissions.getGroupPermissions(name)); - } + IndexedAIP parentSDO = indexService.retrieve(requestContext, IndexedAIP.class, parentId, + RodaConstants.AIP_PERMISSIONS_FIELDS_TO_RETURN); + controllerAssistant.checkObjectPermissions(requestContext.getUser(), parentSDO); - // delegate - return aipService.createAIP(requestContext.getUser(), parentId, type, permissions); - } catch (AlreadyExistsException | GenericException | NotFoundException | RequestNotValidException e) { - state = LogEntryState.FAILURE; - throw new RESTException(e); - } catch (AuthorizationDeniedException e) { - state = LogEntryState.UNAUTHORIZED; - throw new RESTException(e); - } finally { - // register action - controllerAssistant.registerAction(requestContext, state, RodaConstants.CONTROLLER_PARENT_ID_PARAM, parentId, - RodaConstants.CONTROLLER_TYPE_PARAM, type); + // check state + controllerAssistant.checkAIPstate(parentSDO); + + // check if AIP is in a disposal confirmation + controllerAssistant.checkIfAIPInConfirmation(parentSDO); + + Permissions parentPermissions = parentSDO.getPermissions(); + + for (String name : parentPermissions.getUsernames()) { + permissions.setUserPermissions(name, parentPermissions.getUserPermissions(name)); } + + for (String name : parentPermissions.getGroupnames()) { + permissions.setGroupPermissions(name, parentPermissions.getGroupPermissions(name)); + } + + // delegate + return aipService.createAIP(requestContext.getUser(), parentId, type, permissions); + } catch (AlreadyExistsException | GenericException | NotFoundException | RequestNotValidException e) { + state = LogEntryState.FAILURE; + throw new RESTException(e); + } catch (AuthorizationDeniedException e) { + state = LogEntryState.UNAUTHORIZED; + throw new RESTException(e); + } finally { + // register action + controllerAssistant.registerAction(requestContext, state, RodaConstants.CONTROLLER_PARENT_ID_PARAM, parentId, + RodaConstants.CONTROLLER_TYPE_PARAM, type); } + } @Override diff --git a/roda-ui/roda-wui/src/main/java/org/roda/wui/client/browse/BrowseAIP.java b/roda-ui/roda-wui/src/main/java/org/roda/wui/client/browse/BrowseAIP.java index 26f0c08c41..289bbfa8b4 100644 --- a/roda-ui/roda-wui/src/main/java/org/roda/wui/client/browse/BrowseAIP.java +++ b/roda-ui/roda-wui/src/main/java/org/roda/wui/client/browse/BrowseAIP.java @@ -605,7 +605,7 @@ public void onResponseReceived(Request request, Response response) { b.append(SafeHtmlUtils.fromSafeConstant("