Class PermissionImporter
Object
PermissionImporter
- All Implemented Interfaces:
ArtifactImporter<PermissionManifestEntry>
@Service
public class PermissionImporter
extends Object
implements ArtifactImporter<PermissionManifestEntry>
-
Constructor Summary
ConstructorsConstructorDescriptionPermissionImporter(AuthorizationService authService, ProcessoService processoService) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteOrphan(String key, String user) Deletes the artifact identified by the given key, if it exists.Returns the artifact type name this importer handles (e.g.getEntries(GitManifest manifest) Extracts the typed entry list from the manifest.intgetOrder()Returns the execution order.importEntry(PermissionManifestEntry entry, FileResolver resolver, String user) Imports a single entry.
-
Constructor Details
-
PermissionImporter
@Autowired public PermissionImporter(AuthorizationService authService, ProcessoService processoService)
-
-
Method Details
-
getArtifactType
Description copied from interface:ArtifactImporterReturns the artifact type name this importer handles (e.g. "panels", "scripts"). Used for logging and result tracking.- Specified by:
getArtifactTypein interfaceArtifactImporter<PermissionManifestEntry>
-
getOrder
public int getOrder()Description copied from interface:ArtifactImporterReturns the execution order. Lower values run first. This ensures dependencies are imported before dependents (e.g. groups before permissions, queries before reports).- Specified by:
getOrderin interfaceArtifactImporter<PermissionManifestEntry>
-
getEntries
Description copied from interface:ArtifactImporterExtracts the typed entry list from the manifest.- Specified by:
getEntriesin interfaceArtifactImporter<PermissionManifestEntry>- Parameters:
manifest- the parsed manifest- Returns:
- list of entries to import, may be empty
-
deleteOrphan
Description copied from interface:ArtifactImporterDeletes the artifact identified by the given key, if it exists. Called when a key that was previously tracked is no longer present in the manifest. Implementations that cannot safely delete (e.g. require additional context or have active dependencies) should leave this as a no-op.- Specified by:
deleteOrphanin interfaceArtifactImporter<PermissionManifestEntry>- Parameters:
key- the artifact key (sigla) to deleteuser- the login of the user performing the sync
-
importEntry
public ArtifactImportResult importEntry(PermissionManifestEntry entry, FileResolver resolver, String user) Description copied from interface:ArtifactImporterImports a single entry. Handles create-or-update semantics: looks up by key/sigla, creates if missing, updates if exists.- Specified by:
importEntryin interfaceArtifactImporter<PermissionManifestEntry>- Parameters:
entry- the manifest entry to importresolver- resolves relative file paths to input streamsuser- the login of the user performing the import- Returns:
- result indicating what happened (CREATED, UPDATED, SKIPPED, ERROR)
-