<?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 Role Permissions - Possible to get a description of each individual permission? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/role-permissions-possible-to-get-a-description-of/m-p/1368134#M9498</link>
    <description>&lt;P&gt;I'm attempting to inventory the permissions that have been enabled for roles in our enterprise portal.&amp;nbsp; It's straightforward to get the permissions for a given role, and I end up with a list of what seem to be permission id's. For example, one of our roles returns this when I print the permissions:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;['features:user:edit', 'portal:user:joinGroup', 'portal:user:viewOrgGroups', 'portal:user:viewOrgItems', 'portal:user:viewOrgUsers', 'premium:user:demographics', 'premium:user:elevation', 'premium:user:geocode', 'premium:user:networkanalysis']&lt;/LI-CODE&gt;&lt;P&gt;These permission ids correspond with tables in the developer documentation &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html?#role:~:text=property-,privileges,-%C2%B6" target="_self"&gt;Role: ArcGIS API for Python&lt;/A&gt; and include an easy to understand description of what the permission actually does (example below).&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is:&amp;nbsp;&amp;nbsp;&lt;EM&gt;Are these descriptions accessible from the API anywhere?&lt;/EM&gt;&amp;nbsp; I'd like my script to be able to output these descriptions so the inventory is more readable.&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MikeQuetel1_0-1704836832839.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/91013i96487B478E07E305/image-size/large?v=v2&amp;amp;px=999" role="button" title="MikeQuetel1_0-1704836832839.png" alt="MikeQuetel1_0-1704836832839.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jan 2024 21:48:22 GMT</pubDate>
    <dc:creator>Mike_Quetel</dc:creator>
    <dc:date>2024-01-09T21:48:22Z</dc:date>
    <item>
      <title>Role Permissions - Possible to get a description of each individual permission?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/role-permissions-possible-to-get-a-description-of/m-p/1368134#M9498</link>
      <description>&lt;P&gt;I'm attempting to inventory the permissions that have been enabled for roles in our enterprise portal.&amp;nbsp; It's straightforward to get the permissions for a given role, and I end up with a list of what seem to be permission id's. For example, one of our roles returns this when I print the permissions:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;['features:user:edit', 'portal:user:joinGroup', 'portal:user:viewOrgGroups', 'portal:user:viewOrgItems', 'portal:user:viewOrgUsers', 'premium:user:demographics', 'premium:user:elevation', 'premium:user:geocode', 'premium:user:networkanalysis']&lt;/LI-CODE&gt;&lt;P&gt;These permission ids correspond with tables in the developer documentation &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html?#role:~:text=property-,privileges,-%C2%B6" target="_self"&gt;Role: ArcGIS API for Python&lt;/A&gt; and include an easy to understand description of what the permission actually does (example below).&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is:&amp;nbsp;&amp;nbsp;&lt;EM&gt;Are these descriptions accessible from the API anywhere?&lt;/EM&gt;&amp;nbsp; I'd like my script to be able to output these descriptions so the inventory is more readable.&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MikeQuetel1_0-1704836832839.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/91013i96487B478E07E305/image-size/large?v=v2&amp;amp;px=999" role="button" title="MikeQuetel1_0-1704836832839.png" alt="MikeQuetel1_0-1704836832839.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 21:48:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/role-permissions-possible-to-get-a-description-of/m-p/1368134#M9498</guid>
      <dc:creator>Mike_Quetel</dc:creator>
      <dc:date>2024-01-09T21:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Role Permissions - Possible to get a description of each individual permission?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/role-permissions-possible-to-get-a-description-of/m-p/1537574#M10650</link>
      <description>&lt;P&gt;If there is a way to do this within the API for Python or REST API, I would like to know. In the meantime I scraped the info from the REST documentation page. This will work until they change the format of the web page.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from bs4 import BeautifulSoup
import requests
import pandas as pd

def get_privilege_descriptions():
    """Web scrape descriptions for role privileges"""
    response = requests.get("https://developers.arcgis.com/rest/users-groups-and-items/privileges")
    html = response.text
    soup = BeautifulSoup(html, "lxml")
    all_rows = []
    for tr in soup.select('table'):
        if tr.find_previous('h4'):
            h1 = tr.find_previous('h2').get_text(strip=True)
            h2 = tr.find_previous('h3').get_text(strip=True)
            h3 = tr.find_previous('h4').get_text(strip=True)
            headers = []
            row_data = []
            for i, row in enumerate(tr.find_all('tr')):
                if i == 0:
                    headers = [el.text.strip() for el in row.find_all('th')]
                else:
                    row_data = [el.text.strip() for el in row.find_all('td')]
                if headers == ['Privilege', 'Description']:
                    if row_data:
                        all_rows.append([h1, h2, h3] + row_data)
    df = pd.DataFrame(all_rows, columns = ['Org_Type', 'General_or_Admin', 'Privilege_Type', 'Privilege', 'Description'])
    return df

# get dataframe of privilege and description
privilege_df = get_privilege_descriptions()

# display dataframe in jupyter notebook
from IPython.display import HTML
HTML(privilege_df.to_html())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 22:30:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/role-permissions-possible-to-get-a-description-of/m-p/1537574#M10650</guid>
      <dc:creator>Kristen</dc:creator>
      <dc:date>2024-09-11T22:30:12Z</dc:date>
    </item>
  </channel>
</rss>

