mirror of
https://github.com/simonw/datasette.git
synced 2026-06-06 17:16:57 +02:00
Closes #2102 * Permission is now a dataclass, not a namedtuple - refs https://github.com/simonw/datasette/pull/2154/#discussion_r1308087800 * datasette.get_permission() method
16 lines
471 B
Python
16 lines
471 B
Python
from dataclasses import dataclass, fields
|
|
from typing import Optional
|
|
|
|
|
|
@dataclass
|
|
class Permission:
|
|
name: str
|
|
abbr: Optional[str]
|
|
description: Optional[str]
|
|
takes_database: bool
|
|
takes_resource: bool
|
|
default: bool
|
|
# This is deliberately undocumented: it's considered an internal
|
|
# implementation detail for view-table/view-database and should
|
|
# not be used by plugins as it may change in the future.
|
|
implies_can_view: bool = False
|