mirror of
https://github.com/stashapp/stash.git
synced 2026-02-07 16:05:47 +01:00
Add roles to mutations
This commit is contained in:
parent
74970b2abf
commit
3c2630432c
3 changed files with 134 additions and 136 deletions
|
|
@ -279,137 +279,137 @@ type Query {
|
|||
}
|
||||
|
||||
type Mutation {
|
||||
setup(input: SetupInput!): Boolean!
|
||||
setup(input: SetupInput!): Boolean! @hasRole(role: ADMIN)
|
||||
|
||||
"Migrates the schema to the required version. Returns the job ID"
|
||||
migrate(input: MigrateInput!): ID!
|
||||
migrate(input: MigrateInput!): ID! @hasRole(role: ADMIN)
|
||||
|
||||
"Downloads and installs ffmpeg and ffprobe binaries into the configuration directory. Returns the job ID."
|
||||
downloadFFMpeg: ID!
|
||||
downloadFFMpeg: ID! @hasRole(role: ADMIN)
|
||||
|
||||
sceneCreate(input: SceneCreateInput!): Scene
|
||||
sceneUpdate(input: SceneUpdateInput!): Scene
|
||||
sceneMerge(input: SceneMergeInput!): Scene
|
||||
bulkSceneUpdate(input: BulkSceneUpdateInput!): [Scene!]
|
||||
sceneDestroy(input: SceneDestroyInput!): Boolean!
|
||||
scenesDestroy(input: ScenesDestroyInput!): Boolean!
|
||||
scenesUpdate(input: [SceneUpdateInput!]!): [Scene]
|
||||
sceneCreate(input: SceneCreateInput!): Scene @hasRole(role: MODIFY)
|
||||
sceneUpdate(input: SceneUpdateInput!): Scene @hasRole(role: MODIFY)
|
||||
sceneMerge(input: SceneMergeInput!): Scene @hasRole(role: MODIFY)
|
||||
bulkSceneUpdate(input: BulkSceneUpdateInput!): [Scene!] @hasRole(role: MODIFY)
|
||||
sceneDestroy(input: SceneDestroyInput!): Boolean! @hasRole(role: MODIFY)
|
||||
scenesDestroy(input: ScenesDestroyInput!): Boolean! @hasRole(role: MODIFY)
|
||||
scenesUpdate(input: [SceneUpdateInput!]!): [Scene] @hasRole(role: MODIFY)
|
||||
|
||||
"Increments the o-counter for a scene. Returns the new value"
|
||||
sceneIncrementO(id: ID!): Int! @deprecated(reason: "Use sceneAddO instead")
|
||||
sceneIncrementO(id: ID!): Int! @deprecated(reason: "Use sceneAddO instead") @hasRole(role: MODIFY)
|
||||
"Decrements the o-counter for a scene. Returns the new value"
|
||||
sceneDecrementO(id: ID!): Int! @deprecated(reason: "Use sceneRemoveO instead")
|
||||
sceneDecrementO(id: ID!): Int! @deprecated(reason: "Use sceneRemoveO instead") @hasRole(role: MODIFY)
|
||||
|
||||
"Increments the o-counter for a scene. Uses the current time if none provided."
|
||||
sceneAddO(id: ID!, times: [Timestamp!]): HistoryMutationResult!
|
||||
sceneAddO(id: ID!, times: [Timestamp!]): HistoryMutationResult! @hasRole(role: MODIFY)
|
||||
"Decrements the o-counter for a scene, removing the last recorded time if specific time not provided. Returns the new value"
|
||||
sceneDeleteO(id: ID!, times: [Timestamp!]): HistoryMutationResult!
|
||||
sceneDeleteO(id: ID!, times: [Timestamp!]): HistoryMutationResult! @hasRole(role: MODIFY)
|
||||
|
||||
"Resets the o-counter for a scene to 0. Returns the new value"
|
||||
sceneResetO(id: ID!): Int!
|
||||
sceneResetO(id: ID!): Int! @hasRole(role: MODIFY)
|
||||
|
||||
"Sets the resume time point (if provided) and adds the provided duration to the scene's play duration"
|
||||
sceneSaveActivity(id: ID!, resume_time: Float, playDuration: Float): Boolean!
|
||||
sceneSaveActivity(id: ID!, resume_time: Float, playDuration: Float): Boolean! @hasRole(role: MODIFY)
|
||||
|
||||
"Resets the resume time point and play duration"
|
||||
sceneResetActivity(
|
||||
id: ID!
|
||||
reset_resume: Boolean
|
||||
reset_duration: Boolean
|
||||
): Boolean!
|
||||
): Boolean! @hasRole(role: MODIFY)
|
||||
|
||||
"Increments the play count for the scene. Returns the new play count value."
|
||||
sceneIncrementPlayCount(id: ID!): Int!
|
||||
@deprecated(reason: "Use sceneAddPlay instead")
|
||||
@deprecated(reason: "Use sceneAddPlay instead") @hasRole(role: MODIFY)
|
||||
|
||||
"Increments the play count for the scene. Uses the current time if none provided."
|
||||
sceneAddPlay(id: ID!, times: [Timestamp!]): HistoryMutationResult!
|
||||
sceneAddPlay(id: ID!, times: [Timestamp!]): HistoryMutationResult! @hasRole(role: MODIFY)
|
||||
"Decrements the play count for the scene, removing the specific times or the last recorded time if not provided."
|
||||
sceneDeletePlay(id: ID!, times: [Timestamp!]): HistoryMutationResult!
|
||||
sceneDeletePlay(id: ID!, times: [Timestamp!]): HistoryMutationResult! @hasRole(role: MODIFY)
|
||||
"Resets the play count for a scene to 0. Returns the new play count value."
|
||||
sceneResetPlayCount(id: ID!): Int!
|
||||
sceneResetPlayCount(id: ID!): Int! @hasRole(role: MODIFY)
|
||||
|
||||
"Generates screenshot at specified time in seconds. Leave empty to generate default screenshot"
|
||||
sceneGenerateScreenshot(id: ID!, at: Float): String!
|
||||
sceneGenerateScreenshot(id: ID!, at: Float): String! @hasRole(role: ADMIN)
|
||||
|
||||
sceneMarkerCreate(input: SceneMarkerCreateInput!): SceneMarker
|
||||
sceneMarkerUpdate(input: SceneMarkerUpdateInput!): SceneMarker
|
||||
bulkSceneMarkerUpdate(input: BulkSceneMarkerUpdateInput!): [SceneMarker!]
|
||||
sceneMarkerDestroy(id: ID!): Boolean!
|
||||
sceneMarkersDestroy(ids: [ID!]!): Boolean!
|
||||
sceneMarkerCreate(input: SceneMarkerCreateInput!): SceneMarker @hasRole(role: MODIFY)
|
||||
sceneMarkerUpdate(input: SceneMarkerUpdateInput!): SceneMarker @hasRole(role: MODIFY)
|
||||
bulkSceneMarkerUpdate(input: BulkSceneMarkerUpdateInput!): [SceneMarker!] @hasRole(role: MODIFY)
|
||||
sceneMarkerDestroy(id: ID!): Boolean! @hasRole(role: MODIFY)
|
||||
sceneMarkersDestroy(ids: [ID!]!): Boolean! @hasRole(role: MODIFY)
|
||||
|
||||
sceneAssignFile(input: AssignSceneFileInput!): Boolean!
|
||||
sceneAssignFile(input: AssignSceneFileInput!): Boolean! @hasRole(role: MODIFY)
|
||||
|
||||
imageUpdate(input: ImageUpdateInput!): Image
|
||||
bulkImageUpdate(input: BulkImageUpdateInput!): [Image!]
|
||||
imageDestroy(input: ImageDestroyInput!): Boolean!
|
||||
imagesDestroy(input: ImagesDestroyInput!): Boolean!
|
||||
imagesUpdate(input: [ImageUpdateInput!]!): [Image]
|
||||
imageUpdate(input: ImageUpdateInput!): Image @hasRole(role: MODIFY)
|
||||
bulkImageUpdate(input: BulkImageUpdateInput!): [Image!] @hasRole(role: MODIFY)
|
||||
imageDestroy(input: ImageDestroyInput!): Boolean! @hasRole(role: MODIFY)
|
||||
imagesDestroy(input: ImagesDestroyInput!): Boolean! @hasRole(role: MODIFY)
|
||||
imagesUpdate(input: [ImageUpdateInput!]!): [Image] @hasRole(role: MODIFY)
|
||||
|
||||
"Increments the o-counter for an image. Returns the new value"
|
||||
imageIncrementO(id: ID!): Int!
|
||||
imageIncrementO(id: ID!): Int! @hasRole(role: MODIFY)
|
||||
"Decrements the o-counter for an image. Returns the new value"
|
||||
imageDecrementO(id: ID!): Int!
|
||||
imageDecrementO(id: ID!): Int! @hasRole(role: MODIFY)
|
||||
"Resets the o-counter for a image to 0. Returns the new value"
|
||||
imageResetO(id: ID!): Int!
|
||||
imageResetO(id: ID!): Int! @hasRole(role: MODIFY)
|
||||
|
||||
galleryCreate(input: GalleryCreateInput!): Gallery
|
||||
galleryUpdate(input: GalleryUpdateInput!): Gallery
|
||||
bulkGalleryUpdate(input: BulkGalleryUpdateInput!): [Gallery!]
|
||||
galleryDestroy(input: GalleryDestroyInput!): Boolean!
|
||||
galleriesUpdate(input: [GalleryUpdateInput!]!): [Gallery]
|
||||
galleryCreate(input: GalleryCreateInput!): Gallery @hasRole(role: MODIFY)
|
||||
galleryUpdate(input: GalleryUpdateInput!): Gallery @hasRole(role: MODIFY)
|
||||
bulkGalleryUpdate(input: BulkGalleryUpdateInput!): [Gallery!] @hasRole(role: MODIFY)
|
||||
galleryDestroy(input: GalleryDestroyInput!): Boolean! @hasRole(role: MODIFY)
|
||||
galleriesUpdate(input: [GalleryUpdateInput!]!): [Gallery] @hasRole(role: MODIFY)
|
||||
|
||||
addGalleryImages(input: GalleryAddInput!): Boolean!
|
||||
removeGalleryImages(input: GalleryRemoveInput!): Boolean!
|
||||
setGalleryCover(input: GallerySetCoverInput!): Boolean!
|
||||
resetGalleryCover(input: GalleryResetCoverInput!): Boolean!
|
||||
addGalleryImages(input: GalleryAddInput!): Boolean! @hasRole(role: MODIFY)
|
||||
removeGalleryImages(input: GalleryRemoveInput!): Boolean! @hasRole(role: MODIFY)
|
||||
setGalleryCover(input: GallerySetCoverInput!): Boolean! @hasRole(role: MODIFY)
|
||||
resetGalleryCover(input: GalleryResetCoverInput!): Boolean! @hasRole(role: MODIFY)
|
||||
|
||||
galleryChapterCreate(input: GalleryChapterCreateInput!): GalleryChapter
|
||||
galleryChapterUpdate(input: GalleryChapterUpdateInput!): GalleryChapter
|
||||
galleryChapterDestroy(id: ID!): Boolean!
|
||||
galleryChapterCreate(input: GalleryChapterCreateInput!): GalleryChapter @hasRole(role: MODIFY)
|
||||
galleryChapterUpdate(input: GalleryChapterUpdateInput!): GalleryChapter @hasRole(role: MODIFY)
|
||||
galleryChapterDestroy(id: ID!): Boolean! @hasRole(role: MODIFY)
|
||||
|
||||
performerCreate(input: PerformerCreateInput!): Performer
|
||||
performerUpdate(input: PerformerUpdateInput!): Performer
|
||||
performerDestroy(input: PerformerDestroyInput!): Boolean!
|
||||
performersDestroy(ids: [ID!]!): Boolean!
|
||||
bulkPerformerUpdate(input: BulkPerformerUpdateInput!): [Performer!]
|
||||
performerMerge(input: PerformerMergeInput!): Performer!
|
||||
performerCreate(input: PerformerCreateInput!): Performer @hasRole(role: MODIFY)
|
||||
performerUpdate(input: PerformerUpdateInput!): Performer @hasRole(role: MODIFY)
|
||||
performerDestroy(input: PerformerDestroyInput!): Boolean! @hasRole(role: MODIFY)
|
||||
performersDestroy(ids: [ID!]!): Boolean! @hasRole(role: MODIFY)
|
||||
bulkPerformerUpdate(input: BulkPerformerUpdateInput!): [Performer!] @hasRole(role: MODIFY)
|
||||
performerMerge(input: PerformerMergeInput!): Performer! @hasRole(role: MODIFY)
|
||||
|
||||
studioCreate(input: StudioCreateInput!): Studio
|
||||
studioUpdate(input: StudioUpdateInput!): Studio
|
||||
studioDestroy(input: StudioDestroyInput!): Boolean!
|
||||
studiosDestroy(ids: [ID!]!): Boolean!
|
||||
bulkStudioUpdate(input: BulkStudioUpdateInput!): [Studio!]
|
||||
studioCreate(input: StudioCreateInput!): Studio @hasRole(role: MODIFY)
|
||||
studioUpdate(input: StudioUpdateInput!): Studio @hasRole(role: MODIFY)
|
||||
studioDestroy(input: StudioDestroyInput!): Boolean! @hasRole(role: MODIFY)
|
||||
studiosDestroy(ids: [ID!]!): Boolean! @hasRole(role: MODIFY)
|
||||
bulkStudioUpdate(input: BulkStudioUpdateInput!): [Studio!] @hasRole(role: MODIFY)
|
||||
|
||||
movieCreate(input: MovieCreateInput!): Movie
|
||||
@deprecated(reason: "Use groupCreate instead")
|
||||
@deprecated(reason: "Use groupCreate instead") @hasRole(role: MODIFY)
|
||||
movieUpdate(input: MovieUpdateInput!): Movie
|
||||
@deprecated(reason: "Use groupUpdate instead")
|
||||
@deprecated(reason: "Use groupUpdate instead") @hasRole(role: MODIFY)
|
||||
movieDestroy(input: MovieDestroyInput!): Boolean!
|
||||
@deprecated(reason: "Use groupDestroy instead")
|
||||
@deprecated(reason: "Use groupDestroy instead") @hasRole(role: MODIFY)
|
||||
moviesDestroy(ids: [ID!]!): Boolean!
|
||||
@deprecated(reason: "Use groupsDestroy instead")
|
||||
@deprecated(reason: "Use groupsDestroy instead") @hasRole(role: MODIFY)
|
||||
bulkMovieUpdate(input: BulkMovieUpdateInput!): [Movie!]
|
||||
@deprecated(reason: "Use bulkGroupUpdate instead")
|
||||
@deprecated(reason: "Use bulkGroupUpdate instead") @hasRole(role: MODIFY)
|
||||
|
||||
groupCreate(input: GroupCreateInput!): Group
|
||||
groupUpdate(input: GroupUpdateInput!): Group
|
||||
groupDestroy(input: GroupDestroyInput!): Boolean!
|
||||
groupsDestroy(ids: [ID!]!): Boolean!
|
||||
bulkGroupUpdate(input: BulkGroupUpdateInput!): [Group!]
|
||||
groupCreate(input: GroupCreateInput!): Group @hasRole(role: MODIFY)
|
||||
groupUpdate(input: GroupUpdateInput!): Group @hasRole(role: MODIFY)
|
||||
groupDestroy(input: GroupDestroyInput!): Boolean! @hasRole(role: MODIFY)
|
||||
groupsDestroy(ids: [ID!]!): Boolean! @hasRole(role: MODIFY)
|
||||
bulkGroupUpdate(input: BulkGroupUpdateInput!): [Group!] @hasRole(role: MODIFY)
|
||||
|
||||
addGroupSubGroups(input: GroupSubGroupAddInput!): Boolean!
|
||||
removeGroupSubGroups(input: GroupSubGroupRemoveInput!): Boolean!
|
||||
addGroupSubGroups(input: GroupSubGroupAddInput!): Boolean! @hasRole(role: MODIFY)
|
||||
removeGroupSubGroups(input: GroupSubGroupRemoveInput!): Boolean! @hasRole(role: MODIFY)
|
||||
|
||||
"Reorder sub groups within a group. Returns true if successful."
|
||||
reorderSubGroups(input: ReorderSubGroupsInput!): Boolean!
|
||||
reorderSubGroups(input: ReorderSubGroupsInput!): Boolean! @hasRole(role: MODIFY)
|
||||
|
||||
tagCreate(input: TagCreateInput!): Tag
|
||||
tagUpdate(input: TagUpdateInput!): Tag
|
||||
tagDestroy(input: TagDestroyInput!): Boolean!
|
||||
tagsDestroy(ids: [ID!]!): Boolean!
|
||||
tagsMerge(input: TagsMergeInput!): Tag
|
||||
bulkTagUpdate(input: BulkTagUpdateInput!): [Tag!]
|
||||
tagCreate(input: TagCreateInput!): Tag @hasRole(role: MODIFY)
|
||||
tagUpdate(input: TagUpdateInput!): Tag @hasRole(role: MODIFY)
|
||||
tagDestroy(input: TagDestroyInput!): Boolean! @hasRole(role: MODIFY)
|
||||
tagsDestroy(ids: [ID!]!): Boolean! @hasRole(role: MODIFY)
|
||||
tagsMerge(input: TagsMergeInput!): Tag @hasRole(role: MODIFY)
|
||||
bulkTagUpdate(input: BulkTagUpdateInput!): [Tag!] @hasRole(role: MODIFY)
|
||||
|
||||
"""
|
||||
Moves the given files to the given destination. Returns true if successful.
|
||||
|
|
@ -420,90 +420,90 @@ type Mutation {
|
|||
matches one of the media extensions.
|
||||
Creates folder hierarchy if needed.
|
||||
"""
|
||||
moveFiles(input: MoveFilesInput!): Boolean!
|
||||
deleteFiles(ids: [ID!]!): Boolean!
|
||||
moveFiles(input: MoveFilesInput!): Boolean! @hasRole(role: MODIFY)
|
||||
deleteFiles(ids: [ID!]!): Boolean! @hasRole(role: MODIFY)
|
||||
"Deletes file entries from the database without deleting the files from the filesystem"
|
||||
destroyFiles(ids: [ID!]!): Boolean!
|
||||
destroyFiles(ids: [ID!]!): Boolean! @hasRole(role: MODIFY)
|
||||
|
||||
fileSetFingerprints(input: FileSetFingerprintsInput!): Boolean!
|
||||
|
||||
# Saved filters
|
||||
saveFilter(input: SaveFilterInput!): SavedFilter!
|
||||
destroySavedFilter(input: DestroyFilterInput!): Boolean!
|
||||
saveFilter(input: SaveFilterInput!): SavedFilter! @hasRole(role: MODIFY)
|
||||
destroySavedFilter(input: DestroyFilterInput!): Boolean! @hasRole(role: MODIFY)
|
||||
setDefaultFilter(input: SetDefaultFilterInput!): Boolean!
|
||||
@deprecated(reason: "now uses UI config")
|
||||
@deprecated(reason: "now uses UI config") @hasRole(role: MODIFY)
|
||||
|
||||
"Change general configuration options"
|
||||
configureGeneral(input: ConfigGeneralInput!): ConfigGeneralResult!
|
||||
configureInterface(input: ConfigInterfaceInput!): ConfigInterfaceResult!
|
||||
configureDLNA(input: ConfigDLNAInput!): ConfigDLNAResult!
|
||||
configureScraping(input: ConfigScrapingInput!): ConfigScrapingResult!
|
||||
configureGeneral(input: ConfigGeneralInput!): ConfigGeneralResult! @hasRole(role: ADMIN)
|
||||
configureInterface(input: ConfigInterfaceInput!): ConfigInterfaceResult! @hasRole(role: ADMIN)
|
||||
configureDLNA(input: ConfigDLNAInput!): ConfigDLNAResult! @hasRole(role: ADMIN)
|
||||
configureScraping(input: ConfigScrapingInput!): ConfigScrapingResult! @hasRole(role: ADMIN)
|
||||
configureDefaults(
|
||||
input: ConfigDefaultSettingsInput!
|
||||
): ConfigDefaultSettingsResult!
|
||||
): ConfigDefaultSettingsResult! @hasRole(role: ADMIN)
|
||||
|
||||
"overwrites the entire plugin configuration for the given plugin"
|
||||
configurePlugin(plugin_id: ID!, input: Map!): Map!
|
||||
configurePlugin(plugin_id: ID!, input: Map!): Map! @hasRole(role: ADMIN)
|
||||
|
||||
"""
|
||||
overwrites the UI configuration
|
||||
if input is provided, then the entire UI configuration is replaced
|
||||
if partial is provided, then the partial UI configuration is merged into the existing UI configuration
|
||||
"""
|
||||
configureUI(input: Map, partial: Map): Map!
|
||||
configureUI(input: Map, partial: Map): Map! @hasRole(role: ADMIN)
|
||||
"""
|
||||
sets a single UI key value
|
||||
key is a dot separated path to the value
|
||||
"""
|
||||
configureUISetting(key: String!, value: Any): Map!
|
||||
configureUISetting(key: String!, value: Any): Map! @hasRole(role: ADMIN)
|
||||
|
||||
"Generate and set (or clear) API key"
|
||||
generateAPIKey(input: GenerateAPIKeyInput!): String!
|
||||
generateAPIKey(input: GenerateAPIKeyInput!): String! @hasRole(role: ADMIN)
|
||||
|
||||
"Returns a link to download the result"
|
||||
exportObjects(input: ExportObjectsInput!): String
|
||||
exportObjects(input: ExportObjectsInput!): String @hasRole(role: ADMIN)
|
||||
|
||||
"Performs an incremental import. Returns the job ID"
|
||||
importObjects(input: ImportObjectsInput!): ID!
|
||||
importObjects(input: ImportObjectsInput!): ID! @hasRole(role: ADMIN)
|
||||
|
||||
"Start an full import. Completely wipes the database and imports from the metadata directory. Returns the job ID"
|
||||
metadataImport: ID!
|
||||
metadataImport: ID! @hasRole(role: ADMIN)
|
||||
"Start a full export. Outputs to the metadata directory. Returns the job ID"
|
||||
metadataExport: ID!
|
||||
metadataExport: ID! @hasRole(role: ADMIN)
|
||||
"Start a scan. Returns the job ID"
|
||||
metadataScan(input: ScanMetadataInput!): ID!
|
||||
metadataScan(input: ScanMetadataInput!): ID! @hasRole(role: ADMIN)
|
||||
"Start generating content. Returns the job ID"
|
||||
metadataGenerate(input: GenerateMetadataInput!): ID!
|
||||
metadataGenerate(input: GenerateMetadataInput!): ID! @hasRole(role: ADMIN)
|
||||
"Start auto-tagging. Returns the job ID"
|
||||
metadataAutoTag(input: AutoTagMetadataInput!): ID!
|
||||
metadataAutoTag(input: AutoTagMetadataInput!): ID! @hasRole(role: ADMIN)
|
||||
"Clean metadata. Returns the job ID"
|
||||
metadataClean(input: CleanMetadataInput!): ID!
|
||||
metadataClean(input: CleanMetadataInput!): ID! @hasRole(role: ADMIN)
|
||||
"Clean generated files. Returns the job ID"
|
||||
metadataCleanGenerated(input: CleanGeneratedInput!): ID!
|
||||
metadataCleanGenerated(input: CleanGeneratedInput!): ID! @hasRole(role: ADMIN)
|
||||
"Identifies scenes using scrapers. Returns the job ID"
|
||||
metadataIdentify(input: IdentifyMetadataInput!): ID!
|
||||
metadataIdentify(input: IdentifyMetadataInput!): ID! @hasRole(role: ADMIN)
|
||||
|
||||
"Migrate generated files for the current hash naming"
|
||||
migrateHashNaming: ID!
|
||||
migrateHashNaming: ID! @hasRole(role: ADMIN)
|
||||
"Migrates legacy scene screenshot files into the blob storage"
|
||||
migrateSceneScreenshots(input: MigrateSceneScreenshotsInput!): ID!
|
||||
migrateSceneScreenshots(input: MigrateSceneScreenshotsInput!): ID! @hasRole(role: ADMIN)
|
||||
"Migrates blobs from the old storage system to the current one"
|
||||
migrateBlobs(input: MigrateBlobsInput!): ID!
|
||||
migrateBlobs(input: MigrateBlobsInput!): ID! @hasRole(role: ADMIN)
|
||||
|
||||
"Anonymise the database in a separate file. Optionally returns a link to download the database file"
|
||||
anonymiseDatabase(input: AnonymiseDatabaseInput!): String
|
||||
anonymiseDatabase(input: AnonymiseDatabaseInput!): String @hasRole(role: ADMIN)
|
||||
|
||||
"Optimises the database. Returns the job ID"
|
||||
optimiseDatabase: ID!
|
||||
optimiseDatabase: ID! @hasRole(role: ADMIN)
|
||||
|
||||
"Reload scrapers"
|
||||
reloadScrapers: Boolean!
|
||||
reloadScrapers: Boolean! @hasRole(role: ADMIN)
|
||||
|
||||
"""
|
||||
Enable/disable plugins - enabledMap is a map of plugin IDs to enabled booleans.
|
||||
Plugins not in the map are not affected.
|
||||
"""
|
||||
setPluginsEnabled(enabledMap: BoolMap!): Boolean!
|
||||
setPluginsEnabled(enabledMap: BoolMap!): Boolean! @hasRole(role: ADMIN)
|
||||
|
||||
"""
|
||||
Run a plugin task.
|
||||
|
|
@ -520,15 +520,15 @@ type Mutation {
|
|||
description: String
|
||||
args: [PluginArgInput!] @deprecated(reason: "Use args_map instead")
|
||||
args_map: Map
|
||||
): ID!
|
||||
): ID! @hasRole(role: MODIFY)
|
||||
|
||||
"""
|
||||
Runs a plugin operation. The operation is run immediately and does not use the job queue.
|
||||
Returns a map of the result.
|
||||
"""
|
||||
runPluginOperation(plugin_id: ID!, args: Map): Any
|
||||
runPluginOperation(plugin_id: ID!, args: Map): Any @hasRole(role: MODIFY)
|
||||
|
||||
reloadPlugins: Boolean!
|
||||
reloadPlugins: Boolean! @hasRole(role: ADMIN)
|
||||
|
||||
"""
|
||||
Installs the given packages.
|
||||
|
|
@ -536,7 +536,7 @@ type Mutation {
|
|||
If an error occurs when installing a package, the job will continue to install the remaining packages.
|
||||
Returns the job ID
|
||||
"""
|
||||
installPackages(type: PackageType!, packages: [PackageSpecInput!]!): ID!
|
||||
installPackages(type: PackageType!, packages: [PackageSpecInput!]!): ID! @hasRole(role: ADMIN)
|
||||
"""
|
||||
Updates the given packages.
|
||||
If a package is not installed, it will not be installed.
|
||||
|
|
@ -545,49 +545,49 @@ type Mutation {
|
|||
If an error occurs when updating a package, the job will continue to update the remaining packages.
|
||||
Returns the job ID.
|
||||
"""
|
||||
updatePackages(type: PackageType!, packages: [PackageSpecInput!]): ID!
|
||||
updatePackages(type: PackageType!, packages: [PackageSpecInput!]): ID! @hasRole(role: ADMIN)
|
||||
"""
|
||||
Uninstalls the given packages.
|
||||
If an error occurs when uninstalling a package, the job will continue to uninstall the remaining packages.
|
||||
Returns the job ID
|
||||
"""
|
||||
uninstallPackages(type: PackageType!, packages: [PackageSpecInput!]!): ID!
|
||||
uninstallPackages(type: PackageType!, packages: [PackageSpecInput!]!): ID! @hasRole(role: ADMIN)
|
||||
|
||||
stopJob(job_id: ID!): Boolean!
|
||||
stopAllJobs: Boolean!
|
||||
stopJob(job_id: ID!): Boolean! @hasRole(role: ADMIN)
|
||||
stopAllJobs: Boolean! @hasRole(role: ADMIN)
|
||||
|
||||
"Submit fingerprints to stash-box instance"
|
||||
submitStashBoxFingerprints(
|
||||
input: StashBoxFingerprintSubmissionInput!
|
||||
): Boolean!
|
||||
): Boolean! @hasRole(role: MODIFY)
|
||||
|
||||
"Submit scene as draft to stash-box instance"
|
||||
submitStashBoxSceneDraft(input: StashBoxDraftSubmissionInput!): ID
|
||||
submitStashBoxSceneDraft(input: StashBoxDraftSubmissionInput!): ID @hasRole(role: MODIFY)
|
||||
"Submit performer as draft to stash-box instance"
|
||||
submitStashBoxPerformerDraft(input: StashBoxDraftSubmissionInput!): ID
|
||||
submitStashBoxPerformerDraft(input: StashBoxDraftSubmissionInput!): ID @hasRole(role: MODIFY)
|
||||
|
||||
"Backup the database. Optionally returns a link to download the database file"
|
||||
backupDatabase(input: BackupDatabaseInput!): String
|
||||
backupDatabase(input: BackupDatabaseInput!): String @hasRole(role: ADMIN)
|
||||
|
||||
"DANGEROUS: Execute an arbitrary SQL statement that returns rows."
|
||||
querySQL(sql: String!, args: [Any]): SQLQueryResult!
|
||||
querySQL(sql: String!, args: [Any]): SQLQueryResult! @hasRole(role: ADMIN)
|
||||
|
||||
"DANGEROUS: Execute an arbitrary SQL statement without returning any rows."
|
||||
execSQL(sql: String!, args: [Any]): SQLExecResult!
|
||||
execSQL(sql: String!, args: [Any]): SQLExecResult! @hasRole(role: ADMIN)
|
||||
|
||||
"Run batch performer tag task. Returns the job ID."
|
||||
stashBoxBatchPerformerTag(input: StashBoxBatchTagInput!): String!
|
||||
stashBoxBatchPerformerTag(input: StashBoxBatchTagInput!): String! @hasRole(role: ADMIN)
|
||||
"Run batch studio tag task. Returns the job ID."
|
||||
stashBoxBatchStudioTag(input: StashBoxBatchTagInput!): String!
|
||||
stashBoxBatchStudioTag(input: StashBoxBatchTagInput!): String! @hasRole(role: ADMIN)
|
||||
|
||||
"Enables DLNA for an optional duration. Has no effect if DLNA is enabled by default"
|
||||
enableDLNA(input: EnableDLNAInput!): Boolean!
|
||||
enableDLNA(input: EnableDLNAInput!): Boolean! @hasRole(role: ADMIN)
|
||||
"Disables DLNA for an optional duration. Has no effect if DLNA is disabled by default"
|
||||
disableDLNA(input: DisableDLNAInput!): Boolean!
|
||||
disableDLNA(input: DisableDLNAInput!): Boolean! @hasRole(role: ADMIN)
|
||||
"Enables an IP address for DLNA for an optional duration"
|
||||
addTempDLNAIP(input: AddTempDLNAIPInput!): Boolean!
|
||||
addTempDLNAIP(input: AddTempDLNAIPInput!): Boolean! @hasRole(role: ADMIN)
|
||||
"Removes an IP address from the temporary DLNA whitelist"
|
||||
removeTempDLNAIP(input: RemoveTempDLNAIPInput!): Boolean!
|
||||
removeTempDLNAIP(input: RemoveTempDLNAIPInput!): Boolean! @hasRole(role: ADMIN)
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ enum RoleEnum {
|
|||
ADMIN
|
||||
READ
|
||||
MODIFY
|
||||
DELETE
|
||||
}
|
||||
|
||||
directive @hasRole(role: RoleEnum!) on FIELD_DEFINITION
|
||||
|
|
|
|||
|
|
@ -9,10 +9,9 @@ import (
|
|||
type RoleEnum string
|
||||
|
||||
const (
|
||||
RoleEnumAdmin RoleEnum = "admin"
|
||||
RoleEnumRead RoleEnum = "read"
|
||||
RoleEnumModify RoleEnum = "modify"
|
||||
RoleEnumDelete RoleEnum = "delete"
|
||||
RoleEnumAdmin RoleEnum = "ADMIN"
|
||||
RoleEnumRead RoleEnum = "READ"
|
||||
RoleEnumModify RoleEnum = "MODIFY"
|
||||
)
|
||||
|
||||
func (e RoleEnum) Implies(other RoleEnum) bool {
|
||||
|
|
@ -32,7 +31,7 @@ func (e RoleEnum) Implies(other RoleEnum) bool {
|
|||
|
||||
func (e RoleEnum) IsValid() bool {
|
||||
switch e {
|
||||
case RoleEnumRead, RoleEnumModify, RoleEnumDelete, RoleEnumAdmin:
|
||||
case RoleEnumRead, RoleEnumModify, RoleEnumAdmin:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
|
|||
Loading…
Reference in a new issue