import { Mix } from '../../stores/class/radio/mix'; import { Emission } from '../../stores/class/general/emission'; import { Podcast } from '../../stores/class/general/podcast'; import { PlaylistMedia } from '../../stores/class/radio/playlistMedia'; import { Cartouchier } from '../../stores/class/cartouchier/cartouchier'; import { Media } from '../../stores/class/general/media'; import { Conference } from '../../stores/class/conference/conference'; import { Rubrique } from '../../stores/class/rubrique/rubrique'; import { Rubriquage } from '../../stores/class/rubrique/rubriquage'; export declare enum ActionRight { /** User can perform the action */ Allowed = "allowed", /** User lacks the required role */ DeniedNoRight = "no_right", /** User has a restricted role but does not own the resource **/ DeniedNotOwner = "not_owner", /** User is scoped to specific rubriques */ DeniedInsufficientScope = "no_scope" } /** * Composable to manage rights. * Based on AuthStore, but converts roles to easily usable tests for various * actions. */ export declare const useRights: () => { getParticipantEditRight: (participantId: number | undefined) => Promise; canEditParticipant: (participantId: number | undefined) => Promise; canDeleteParticipant: (participantId: number | undefined) => Promise; canReadRSSRules: () => boolean; canEditRSSRules: () => boolean; canSeeHistory: () => boolean; isRestrictedProduction: () => boolean; canCreateEmission: () => boolean; canEditEmission: (emission: Emission) => boolean; canDeleteEmission: (emission: Emission) => boolean; canEditCommentsConfigEmission: () => boolean; canCreatePodcast: (emission?: Emission) => boolean; canDuplicatePodcast: () => boolean; canEditPodcast: (podcast: Podcast) => boolean; canDeletePodcast: (podcast: Podcast) => boolean; canValidatePodcast: () => boolean; canEditCommentsConfigPodcast: () => boolean; canCreatePlaylist: () => boolean; canEditPlaylist: () => boolean; canDeletePlaylist: () => boolean; canCreateParticipant: () => boolean; canCreateRubriques: () => boolean; canEditRubriques: (_element: Rubrique | Rubriquage) => boolean; canCreateAggregator: () => boolean; canEditAggregator: () => boolean; canDeleteAggregator: () => boolean; canCreateCartouchier: () => boolean; canEditCartouchier: (element: Cartouchier) => boolean; canDeleteCartouchier: (element: Cartouchier) => boolean; canCreatePlaylistMedia: () => boolean; canEditPlaylistMedia: (element: PlaylistMedia) => boolean; canDeletePlaylistMedia: (element: PlaylistMedia) => boolean; canCreateMedia: () => boolean; canEditMedia: (element: Media) => boolean; canDeleteMedia: (element: Media) => boolean; canCreateMix: () => boolean; canEditMix: (_element: Mix) => boolean; canDeleteMix: (element: Mix) => boolean; canEditTranscript: (podcast: Podcast) => boolean; canEditTranscriptVisibility: (podcast: Podcast) => boolean; canEditTranslation: (podcast: Podcast) => boolean; canAccessRecording: (conference: Conference, isLive: boolean) => boolean; canEditCodeInsertPlayer: () => boolean; canEditChaptering: (podcast: Podcast) => boolean; canCreatePromoVideo: (podcast: Podcast) => boolean; canEditPromoVideo: (podcast: Podcast) => boolean; canDeletePromoVideo: (podcast: Podcast) => boolean; getCreateEmissionRight: () => ActionRight; getEditEmissionRight: (emission: Emission) => ActionRight; getDeleteEmissionRight: (emission: Emission) => ActionRight; getEditCommentsConfigEmissionRight: () => ActionRight; getCreatePodcastRight: (emission?: Emission) => ActionRight; getDuplicatePodcastRight: () => ActionRight; getEditPodcastRight: (podcast: Podcast) => ActionRight; getDeletePodcastRight: (podcast: Podcast) => ActionRight; getValidatePodcastRight: () => ActionRight; getEditCommentsConfigPodcastRight: () => ActionRight; getCreatePlaylistRight: () => ActionRight; getEditPlaylistRight: () => ActionRight; getDeletePlaylistRight: () => ActionRight; getCreateParticipantRight: () => ActionRight; getCreateRubriquesRight: () => ActionRight; getEditRubriquesRight: (_element: Rubrique | Rubriquage) => ActionRight; getCreateAggregatorRight: () => ActionRight; getEditAggregatorRight: () => ActionRight; getDeleteAggregatorRight: () => ActionRight; getCreateCartouchierRight: () => ActionRight; getEditCartouchierRight: (element: Cartouchier) => ActionRight; getDeleteCartouchierRight: (element: Cartouchier) => ActionRight; getCreatePlaylistMediaRight: () => ActionRight; getEditPlaylistMediaRight: (element: PlaylistMedia) => ActionRight; getDeletePlaylistMediaRight: (element: PlaylistMedia) => ActionRight; getCreateMediaRight: () => ActionRight; getEditMediaRight: (element: Media) => ActionRight; getDeleteMediaRight: (element: Media) => ActionRight; getCreateMixRight: () => ActionRight; getEditMixRight: (_element: Mix) => ActionRight; getDeleteMixRight: (element: Mix) => ActionRight; getEditTranscriptRight: (podcast: Podcast) => ActionRight; getEditTranscriptVisibilityRight: (podcast: Podcast) => ActionRight; getEditTranslationRight: (podcast: Podcast) => ActionRight; getAccessRecordingRight: (conference: Conference, isLive: boolean) => ActionRight; getEditCodeInsertPlayerRight: () => ActionRight; getEditChapteringRight: (podcast: Podcast) => ActionRight; getCreatePromoVideoRight: (podcast: Podcast) => ActionRight; getEditPromoVideoRight: (podcast: Podcast) => ActionRight; getDeletePromoVideoRight: (podcast: Podcast) => ActionRight; };