import logging

from django.contrib.auth.models import Group, Permission

from .models.user_constants import DJ, GUEST, PROGRAM_MANAGER, USER_TYPES

logger = logging.getLogger(__name__)

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",
]
DJ_PERMISSIONS = GUEST_PERMISSIONS + [
    "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",
]
PROGRAM_MANAGER_PERMISSIONS = GUEST_PERMISSIONS + [
    "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",
]

GROUPS = {
    GUEST: GUEST_PERMISSIONS,
    DJ: DJ_PERMISSIONS,
    PROGRAM_MANAGER: PROGRAM_MANAGER,
}
