libretime/api/libretime_api/permission_constants.py

106 lines
2.5 KiB
Python
Raw Permalink Normal View History

from .core.models.role import Role
2020-01-30 14:47:36 +01:00
2021-05-27 16:23:02 +02:00
GUEST_PERMISSIONS = [
"view_schedule",
"view_show",
"view_showdays",
"view_showhost",
"view_showinstance",
"view_showrebroadcast",
"view_file",
"view_podcast",
"view_podcastepisode",
"view_playlist",
"view_playlistcontent",
"view_smartblock",
"view_smartblockcontent",
"view_smartblockcriteria",
"view_webstream",
"view_apiroot",
]
2022-06-27 17:13:05 +02:00
HOST_PERMISSIONS = GUEST_PERMISSIONS + [
2021-05-27 16:23:02 +02:00
"add_file",
"add_podcast",
"add_podcastepisode",
"add_playlist",
"add_playlistcontent",
"add_smartblock",
"add_smartblockcontent",
"add_smartblockcriteria",
"add_webstream",
"change_own_schedule",
"change_own_file",
"change_own_podcast",
"change_own_podcastepisode",
"change_own_playlist",
"change_own_playlistcontent",
"change_own_smartblock",
"change_own_smartblockcontent",
"change_own_smartblockcriteria",
"change_own_webstream",
"delete_own_schedule",
"delete_own_file",
"delete_own_podcast",
"delete_own_podcastepisode",
"delete_own_playlist",
"delete_own_playlistcontent",
"delete_own_smartblock",
"delete_own_smartblockcontent",
"delete_own_smartblockcriteria",
"delete_own_webstream",
]
MANAGER_PERMISSIONS = GUEST_PERMISSIONS + [
2021-05-27 16:23:02 +02:00
"add_show",
"add_showdays",
"add_showhost",
"add_showinstance",
"add_showrebroadcast",
"add_file",
"add_podcast",
"add_podcastepisode",
"add_playlist",
"add_playlistcontent",
"add_smartblock",
"add_smartblockcontent",
"add_smartblockcriteria",
"add_webstream",
"change_schedule",
"change_show",
"change_showdays",
"change_showhost",
"change_showinstance",
"change_showrebroadcast",
"change_file",
"change_podcast",
"change_podcastepisode",
"change_playlist",
"change_playlistcontent",
"change_smartblock",
"change_smartblockcontent",
"change_smartblockcriteria",
"change_webstream",
"delete_schedule",
"delete_show",
"delete_showdays",
"delete_showhost",
"delete_showinstance",
"delete_showrebroadcast",
"delete_file",
"delete_podcast",
"delete_podcastepisode",
"delete_playlist",
"delete_playlistcontent",
"delete_smartblock",
"delete_smartblockcontent",
"delete_smartblockcriteria",
"delete_webstream",
]
2020-01-30 14:47:36 +01:00
GROUPS = {
Role.GUEST.value: GUEST_PERMISSIONS,
2022-06-27 17:13:05 +02:00
Role.HOST.value: HOST_PERMISSIONS,
Role.MANAGER.value: MANAGER_PERMISSIONS,
2020-01-30 14:47:36 +01:00
}