from enum import Enum


class Permissions(Enum):
    """ """

    """
        Administration
    """
    # administrator
    administrator = "administrator"

    # api keys
    api_keys = "api_keys"
    api_keys_create = "api_keys.create"
    api_keys_update = "api_keys.update"
    api_keys_delete = "api_keys.delete"

    # users
    users = "users"
    users_create = "users.create"
    users_update = "users.update"
    users_delete = "users.delete"

    # settings
    settings = "settings"
    settings_update = "settings.update"

    # domains
    domains = "domains"
    domains_create = "domains.create"
    domains_update = "domains.update"
    domains_delete = "domains.delete"

    # user spaces
    user_spaces = "user_spaces"
    user_spaces_create = "user_spaces.create"
    user_spaces_update = "user_spaces.update"
    user_spaces_delete = "user_spaces.delete"

    """
        Permissions
    """
    # roles
    roles = "roles"
    roles_create = "roles.create"
    roles_update = "roles.update"
    roles_delete = "roles.delete"

    """
        Public
    """
    # groups
    groups = "groups"
    groups_create = "groups.create"
    groups_update = "groups.update"
    groups_delete = "groups.delete"

    # short_urls
    short_urls = "short_urls"
    short_urls_by_assignment = "short_urls.by_assignment"
    short_urls_create = "short_urls.create"
    short_urls_update = "short_urls.update"
    short_urls_delete = "short_urls.delete"


PERMISSION_DESCRIPTIONS = {
    Permissions.users_update: "Edit users, including changing their roles",
    Permissions.short_urls: "See all URLs",
    Permissions.short_urls_by_assignment: "See all short urls assigned to a group by role",
}
