애플리케이션 역할: 컨슈머가 동일한 데이터에 대한 다양한 뷰를 공유할 수 있도록 허용¶
공급자는 |declarative-app-short|에서 애플리케이션 역할을 포함하여 컨슈머 경험을 향상할 수 있습니다. 애플리케이션 역할은 |declarative-app-short|의 컨텍스트 내에서 생성된 자격 증명입니다. 애플리케이션 역할에 대한 자세한 내용은 애플리케이션 역할 정보 섹션을 참조하세요.
애플리케이션 역할은 애플리케이션의 보안을 격리하므로 애플리케이션의 특정 보안 자격 증명을 컨슈머의 광범위한 조직 보안 모델 내에서 관리할 필요가 없습니다. 공급자는 애플리케이션 역할을 사용하여 애플리케이션 리소스에 대한 액세스를 간단히 제어할 수 있습니다. 그런 다음 컨슈머 계정은 간단한 SQL GRANT 문을 사용하여 애플리케이션 논리와 데이터에 대한 액세스 권한을 부여할 수 있습니다.
예를 들어 애플리케이션이 작업 애플리케이션 역할을 사용하여 로그 테이블에 액세스하는 경우 컨슈머는 애플리케이션 컨텍스트 외부에서 해당 애플리케이션 역할을 유지할 필요가 없습니다. 작업 애플리케이션 역할을 사용하여 애플리케이션을 지원팀과 공유할 수 있다는 것만 알면 됩니다.
매니페스트 파일을 사용하여 애플리케이션 역할을 정의하고 앱의 콘텐츠에 할당합니다. 컨슈머는 앱을 설치할 때 조직 역할 및 사용자에게 애플리케이션 역할을 할당하여 조직 구성원과 콘텐츠를 공유할 수 있습니다. 컨슈머는 애플리케이션 역할을 다른 애플리케이션 역할에 할당하여 애플리케이션 역할의 계층 구조를 만들 수도 있습니다.
컨슈머는 애플리케이션 역할을 통해 조직의 구성원과 다양한 방식으로 데이터를 공유할 수 있습니다. 예를 들어, 앱에는 데이터를 표시하는 두 개의 노트북이 포함될 수 있으며, 하나는 데이터의 전체 뷰를 포함하고 다른 하나는 필터링된 뷰를 포함합니다.
그러면 컨슈머 앱 소유자는 필터링된 뷰를 팀과 공유하면서 전체 뷰에 계속 액세스할 수 있습니다.
애플리케이션 역할을 사용하여 데이터베이스 리소스에 대한 액세스를 허용하면 하위 리소스는 상위 리소스의 역할을 상속합니다. 예를 들어, 스키마에 애플리케이션 역할을 할당하면 해당 스키마의 모든 테이블과 뷰가 역할을 상속합니다. 데이터베이스에 애플리케이션 역할을 할당하면 해당 데이터베이스의 모든 스키마, 테이블, 뷰가 역할을 상속합니다.
매니페스트 파일의 콘텐츠에 애플리케이션 역할 할당하기¶
매니페스트 파일<label_sa-manifest-roles-top>`의 :ref:`최상위 역할 필드<label_sa-manifest-roles-top>`에서 사용 가능한 애플리케이션 역할을 정의합니다(예: :code:`sales,
marketing및operations).roles: - sales: comment: "The sales role provides access to the filtered view of the sales data." - marketing: comment: "The marketing role provides access to the filtered view of the marketing data." - operations: comment: "The operations role provides access to the full view of the data, including logs."
Copy목록을 사용하여 매니페스트 파일의 내용에 앱 역할을 할당합니다(예:
roles: [sales, support]).- customer_table: roles: [sales,marketing] # Accessible to sales and marketing, app owners
Copy테이블을 추가하려면 테이블이 있는
<named table>.roles및<named schema>.roles모두에 역할을 추가합니다.schemas: - sales_table: roles: [sales] tables: - sales_table: roles: [sales]
Copy뷰를 추가하려면 뷰가 있는
<named view>.roles및<named schema>.roles모두에 역할을 추가합니다.schemas: - sales_view: roles: [sales] views: - sales_view: roles: [sales]
Copy테이블의 필터링된 뷰를 추가할 때 기본 테이블을 추가하면 사용자가 필터링되지 않은 데이터에 액세스할 수 없으므로 추가하지 마세요.
노트북을 포함하려면 :code:`<named notebook>.roles`에 역할을 추가하고 노트북에서 참조되는 테이블과 뷰(및 해당 기본 스키마)를 추가합니다.
notebooks: - SALES_NB: main_file: ALL-DATA.ipynb roles: [sales] comment: Accessible to sales and app owners, references full view of the sales data
Copy뷰 또는 테이블의 필터링된 뷰를 참조하는 노트북을 추가할 때 기본 테이블을 추가하면 사용자가 필터링되지 않은 데이터에 액세스할 수 없으므로 추가하지 마세요.
오브젝트에 앱 역할을 부여하지 않으려면 필드를 비워 두거나(
[]) 생략합니다. 이러한 오브젝트는 앱 소유자 및 IMPORTED PRIVILEGES이 부여된 역할만 액세스할 수 있습니다.
- my_schema: roles: [] # Accessible to app owners onlyCopy
매니페스트 파일 예제:
roles:
- sales:
comment: "The sales role provides access to the filtered view of the sales data."
- marketing:
comment: "The marketing role provides access to the filtered view of the marketing data."
- operations:
comment: "The operations role provides access to the full view of the log data."
application_content:
notebooks:
- SALES_NB:
main_file: ALL-DATA.ipynb
roles: [sales]
comment: Accessible to sales and app owners, references full view of the sales data
- MARKETING_NB:
main_file: FILTERED.ipynb
roles: [marketing] #
comment: Accessible to marketing and app owners, references filtered view of the marketing data
shared_content:
databases:
- my_database:
schemas:
- my_schema:
roles: [] # Accessible to app owners
tables:
- sales_table:
roles: [sales] # Accessible to sales, app owners
- marketing_table:
roles: [marketing] # Accessible to marketing, app owners
- customer_table:
roles: [sales,marketing] # Accessible to sales and marketing, app owners
- logs_table:
roles: [operations] # Accessible to operations and app owners
views:
- sales_view:
roles: [sales] # Accessible to sales and app owners
- marketing_view:
roles: [marketing] # Accessible to marketing and app owners
- customer_view:
roles: [sales,marketing] # Accessible to sales, marketing, and app owners
- operations_view:
roles: [operations] # Accessible to operations and app owners
나중에 컨슈머가 앱을 설치하면 노트북, 테이블, 뷰에 모두 액세스할 수 있습니다.
운영 뷰를 지원팀과 공유하기 위해 지원팀 조직 역할에 작업 애플리케이션 역할을 부여합니다.
GRANT APPLICATION ROLE customer_app.operations TO ROLE support_team_west;
support_team_west 역할의 컨슈머 팀 구성원은 로그 테이블을 볼 수 있지만, |sf-web-interface|의 사용 가능한 노트북 탭에서 노트북을 보거나 영업 및 고객 테이블과 뷰에 액세스할 수 없습니다.
영업 뷰를 영업 팀과 공유하기 위해 영업 조직 역할에 영업 애플리케이션 역할을 부여합니다.
GRANT APPLICATION ROLE customer_app.sales TO ROLE sales_team_east;
sales_team_east 역할의 컨슈머 팀 구성원 역할은 |sf-web-interface|의 사용 가능한 노트북 탭에서 노트북 볼 수 있습니다. 로그 테이블은 볼 수 없지만, 영업 및 고객 테이블과 뷰에는 액세스할 수 있습니다.
컨슈머가 역할을 공유하는 방법에 대한 자세한 내용은 앱에 대한 액세스 공유하기 섹션을 참조하세요.