<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Automating Job Permission Updates in Databricks Using a Notebook in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/automating-job-permission-updates-in-databricks-using-a-notebook/m-p/157391#M54542</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/177179"&gt;@Raj_DB&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can use &lt;A href="https://docs.databricks.com/aws/en/dev-tools/sdk-python" target="_self"&gt;databricks SDK&lt;/A&gt; to retrieve all jobs filter them by selecting only those where owner is current user&lt;BR /&gt;something like this&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from databricks.sdk import WorkspaceClient

w = WorkspaceClient()

# Specify the user email/username you want to filter for
current_user = w.current_user.me()

# Retrieve and filter jobs
user_jobs = [
    job for job in w.jobs.list() 
    if job.creator_user_name == current_user.userName
]

# Print the results
for job in user_jobs:
    print(f"Job ID: {job.job_id}, Name: {job.settings.name}")

    permissions = w.jobs.get_permissions(job_id=job.job_id)
    for access_control in permissions.access_control_list:
        print(f"Principal: {access_control.user_name or access_control.group_name}")
        print(f"Permission Level: {access_control.all_permissions[0].permission_level}")
    &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;APIs of interest&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/workspace/jobs/get" target="_blank"&gt;https://docs.databricks.com/api/workspace/jobs/get&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/workspace/jobs/getpermissions" target="_blank"&gt;https://docs.databricks.com/api/workspace/jobs/getpermissions&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/workspace/jobs/updatepermissions" target="_blank"&gt;https://docs.databricks.com/api/workspace/jobs/updatepermissions&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 May 2026 10:18:44 GMT</pubDate>
    <dc:creator>ziafazal</dc:creator>
    <dc:date>2026-05-21T10:18:44Z</dc:date>
    <item>
      <title>Automating Job Permission Updates in Databricks Using a Notebook</title>
      <link>https://community.databricks.com/t5/data-engineering/automating-job-permission-updates-in-databricks-using-a-notebook/m-p/157350#M54534</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am looking to create a notebook that, when executed by a user, performs the following actions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Retrieves all Databricks jobs created by the current user&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Checks whether a specific role already has permissions on those jobs&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Automatically adds the required role permission if it is missing&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The goal is to ensure that all jobs created within our team are visible and manageable by a common team role for better collaboration.&lt;/P&gt;&lt;P&gt;I am looking for the best approach, sample implementations, or best practices would be appreciated.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2026 17:42:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/automating-job-permission-updates-in-databricks-using-a-notebook/m-p/157350#M54534</guid>
      <dc:creator>Raj_DB</dc:creator>
      <dc:date>2026-05-20T17:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Automating Job Permission Updates in Databricks Using a Notebook</title>
      <link>https://community.databricks.com/t5/data-engineering/automating-job-permission-updates-in-databricks-using-a-notebook/m-p/157391#M54542</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/177179"&gt;@Raj_DB&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can use &lt;A href="https://docs.databricks.com/aws/en/dev-tools/sdk-python" target="_self"&gt;databricks SDK&lt;/A&gt; to retrieve all jobs filter them by selecting only those where owner is current user&lt;BR /&gt;something like this&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from databricks.sdk import WorkspaceClient

w = WorkspaceClient()

# Specify the user email/username you want to filter for
current_user = w.current_user.me()

# Retrieve and filter jobs
user_jobs = [
    job for job in w.jobs.list() 
    if job.creator_user_name == current_user.userName
]

# Print the results
for job in user_jobs:
    print(f"Job ID: {job.job_id}, Name: {job.settings.name}")

    permissions = w.jobs.get_permissions(job_id=job.job_id)
    for access_control in permissions.access_control_list:
        print(f"Principal: {access_control.user_name or access_control.group_name}")
        print(f"Permission Level: {access_control.all_permissions[0].permission_level}")
    &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;APIs of interest&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/workspace/jobs/get" target="_blank"&gt;https://docs.databricks.com/api/workspace/jobs/get&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/workspace/jobs/getpermissions" target="_blank"&gt;https://docs.databricks.com/api/workspace/jobs/getpermissions&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/api/workspace/jobs/updatepermissions" target="_blank"&gt;https://docs.databricks.com/api/workspace/jobs/updatepermissions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2026 10:18:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/automating-job-permission-updates-in-databricks-using-a-notebook/m-p/157391#M54542</guid>
      <dc:creator>ziafazal</dc:creator>
      <dc:date>2026-05-21T10:18:44Z</dc:date>
    </item>
  </channel>
</rss>

