Module: Tableau::Util::Permissions

Included in:
Datasources, Project, Workbook
Defined in:
lib/tableau_ruby/util/permissions.rb

Instance Method Summary collapse

Instance Method Details

#build_permissions_for_group(xml, params) ⇒ Object


14
15
16
17
18
19
20
21
22
# File 'lib/tableau_ruby/util/permissions.rb', line 14

def build_permissions_for_group(xml, params)
  xml.granteeCapabilities do
    xml.group(id: params[:group_id])
    xml.capabilities do
      params[:permissions][:allow].each { |c| xml.capability(name: c, mode: 'Allow') }
      params[:permissions][:deny].each  { |c| xml.capability(name: c, mode: 'Deny') }
    end
  end
end

#build_permissions_for_user(xml, params) ⇒ Object


4
5
6
7
8
9
10
11
12
# File 'lib/tableau_ruby/util/permissions.rb', line 4

def build_permissions_for_user(xml, params)
  xml.granteeCapabilities do
    xml.user(id: params[:user_id])
    xml.capabilities do
      params[:permissions][:allow].each { |c| xml.capability(name: c, mode: 'Allow') }
      params[:permissions][:deny].each  { |c| xml.capability(name: c, mode: 'Deny') }
    end
  end
end