Skip to content

Commit de70112

Browse files
authored
Internal documentation: clarify the (different) purpose of the grant and permission crawlers (#2592)
## Changes Following some #2074-related discussions yesterday, this PR adds some internal documentation to clarify the intended (different) purposes of the grants and permissions crawlers.
1 parent 0de0ed0 commit de70112

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/databricks/labs/ucx/assessment/workflows.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ def setup_tacl(self, ctx: RuntimeContext):
2525

2626
@job_task(depends_on=[crawl_tables, setup_tacl], job_cluster="tacl")
2727
def crawl_grants(self, ctx: RuntimeContext):
28-
"""Scans the previously created Delta table named `$inventory_database.tables` and issues a `SHOW GRANTS`
29-
statement for every object to retrieve the permissions it has assigned to it. The permissions include information
30-
such as the _principal_, _action type_, and the _table_ it applies to. This is persisted in the Delta table
31-
`$inventory_database.grants`. Other, migration related jobs use this inventory table to convert the legacy Table
32-
ACLs to Unity Catalog permissions.
28+
"""Scans all securable objects for permissions that have been assigned: this include database-level permissions,
29+
as well permissions directly configured on objects in the (already gathered) table and UDF inventories. The
30+
captured information is stored in the `$inventory_database.grants` inventory table for further use during the
31+
migration of legacy ACLs to Unity Catalog permissions.
3332
3433
Note: This job runs on a separate cluster (named `tacl`) as it requires the proper configuration to have the Table
3534
ACLs enabled and available for retrieval."""

src/databricks/labs/ucx/hive_metastore/grants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ def uc_grant_sql(self, object_type: str | None = None, object_key: str | None =
196196

197197

198198
class GrantsCrawler(CrawlerBase[Grant]):
199+
"""Crawler that captures access controls that relate to data and other securable objects."""
200+
199201
def __init__(self, tc: TablesCrawler, udf: UdfsCrawler, include_databases: list[str] | None = None):
200202
assert tc._backend == udf._backend
201203
assert tc._catalog == udf._catalog

src/databricks/labs/ucx/workspace_access/manager.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414

1515

1616
class PermissionManager(CrawlerBase[Permissions]):
17+
"""Crawler that captures permissions, intended for configuration-related (non-data) objects.
18+
19+
The set of objects types captured depends on the (sub)-crawlers supplied to the initializer, but is intended to
20+
cover configuration-related (non-data) objects such as workspace configuration, dashboards, secrets, SCIM
21+
entitlements, etc.
22+
"""
23+
1724
ERRORS_TO_IGNORE = ["FEATURE_DISABLED"]
1825

1926
def __init__(self, backend: SqlBackend, inventory_database: str, crawlers: list[AclSupport]):

0 commit comments

Comments
 (0)