Class: Superset::Security::Role::Permission::Create

Inherits:
Request
  • Object
show all
Defined in:
lib/superset/security/role/permission/create.rb

Constant Summary

Constants inherited from Request

Request::PAGE_SIZE

Instance Attribute Summary collapse

Attributes inherited from Request

#page_num

Instance Method Summary collapse

Methods inherited from Request

call, #query_params, #result, #superset_host

Methods included from Display

#display_headers, #headings, #list, #list_attributes, #result, #rows, #table, #title

Constructor Details

#initialize(role_id:, permission_view_menu_ids: []) ⇒ Create

Returns a new instance of Create.



8
9
10
11
# File 'lib/superset/security/role/permission/create.rb', line 8

def initialize(role_id:, permission_view_menu_ids: [])
  @permission_view_menu_ids = permission_view_menu_ids
  @role_id = role_id
end

Instance Attribute Details

#permission_view_menu_idsObject (readonly)

Returns the value of attribute permission_view_menu_ids.



6
7
8
# File 'lib/superset/security/role/permission/create.rb', line 6

def permission_view_menu_ids
  @permission_view_menu_ids
end

#role_idObject (readonly)

Returns the value of attribute role_id.



6
7
8
# File 'lib/superset/security/role/permission/create.rb', line 6

def role_id
  @role_id
end

Instance Method Details

#responseObject



13
14
15
16
17
18
# File 'lib/superset/security/role/permission/create.rb', line 13

def response
  raise InvalidParameterError unless valid_params?

  @response ||= client.post(route,
                            { "permission_view_menu_ids": permission_view_menu_ids } )
end