Skip to content

/AWS1/CL_LKF=>BATCHGRANTPERMISSIONS()

About BatchGrantPermissions

Batch operation to grant permissions to the principal.

Method Signature

IMPORTING

Required arguments:

it_entries TYPE /AWS1/CL_LKFBATCHPERMSREQENTRY=>TT_BATCHPERMSREQUESTENTRYLIST TT_BATCHPERMSREQUESTENTRYLIST

A list of up to 20 entries for resource permissions to be granted by batch operation to the principal.

Optional arguments:

iv_catalogid TYPE /AWS1/LKFCATALOGIDSTRING /AWS1/LKFCATALOGIDSTRING

The identifier for the Data Catalog. By default, the account ID. The Data Catalog is the persistent metadata store. It contains database definitions, table definitions, and other control information to manage your Lake Formation environment.

RETURNING

oo_output TYPE REF TO /aws1/cl_lkfbatchgrantpermsrsp /AWS1/CL_LKFBATCHGRANTPERMSRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_lkf~batchgrantpermissions(
  it_entries = VALUE /aws1/cl_lkfbatchpermsreqentry=>tt_batchpermsrequestentrylist(
    (
      new /aws1/cl_lkfbatchpermsreqentry(
        io_condition = new /aws1/cl_lkfcondition( |string| )
        io_principal = new /aws1/cl_lkfdatalakeprincipal( |string| )
        io_resource = new /aws1/cl_lkfresource(
          io_catalog = new /aws1/cl_lkfcatalogresource( |string| )
          io_database = new /aws1/cl_lkfdatabaseresource(
            iv_catalogid = |string|
            iv_name = |string|
          )
          io_datacellsfilter = new /aws1/cl_lkfdatacellsfiltresrc(
            iv_databasename = |string|
            iv_name = |string|
            iv_tablecatalogid = |string|
            iv_tablename = |string|
          )
          io_datalocation = new /aws1/cl_lkfdatalocresource(
            iv_catalogid = |string|
            iv_resourcearn = |string|
          )
          io_lftag = new /aws1/cl_lkflftagkeyresource(
            it_tagvalues = VALUE /aws1/cl_lkftagvaluelist_w=>tt_tagvaluelist(
              ( new /aws1/cl_lkftagvaluelist_w( |string| ) )
            )
            iv_catalogid = |string|
            iv_tagkey = |string|
          )
          io_lftagexpression = new /aws1/cl_lkflftagxprsnresource(
            iv_catalogid = |string|
            iv_name = |string|
          )
          io_lftagpolicy = new /aws1/cl_lkflftagplyresource(
            it_expression = VALUE /aws1/cl_lkflftag=>tt_expression(
              (
                new /aws1/cl_lkflftag(
                  it_tagvalues = VALUE /aws1/cl_lkftagvaluelist_w=>tt_tagvaluelist(
                    ( new /aws1/cl_lkftagvaluelist_w( |string| ) )
                  )
                  iv_tagkey = |string|
                )
              )
            )
            iv_catalogid = |string|
            iv_expressionname = |string|
            iv_resourcetype = |string|
          )
          io_table = new /aws1/cl_lkftableresource(
            io_tablewildcard = new /aws1/cl_lkftablewildcard( )
            iv_catalogid = |string|
            iv_databasename = |string|
            iv_name = |string|
          )
          io_tablewithcolumns = new /aws1/cl_lkftblwthcolumnsresrc(
            io_columnwildcard = new /aws1/cl_lkfcolumnwildcard(
              it_excludedcolumnnames = VALUE /aws1/cl_lkfcolumnnames_w=>tt_columnnames(
                ( new /aws1/cl_lkfcolumnnames_w( |string| ) )
              )
            )
            it_columnnames = VALUE /aws1/cl_lkfcolumnnames_w=>tt_columnnames(
              ( new /aws1/cl_lkfcolumnnames_w( |string| ) )
            )
            iv_catalogid = |string|
            iv_databasename = |string|
            iv_name = |string|
          )
        )
        it_permissions = VALUE /aws1/cl_lkfpermissionlist_w=>tt_permissionlist(
          ( new /aws1/cl_lkfpermissionlist_w( |string| ) )
        )
        it_permswithgrantoption = VALUE /aws1/cl_lkfpermissionlist_w=>tt_permissionlist(
          ( new /aws1/cl_lkfpermissionlist_w( |string| ) )
        )
        iv_id = |string|
      )
    )
  )
  iv_catalogid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_failures( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lo_batchpermissionsrequest = lo_row_1->get_requestentry( ).
      IF lo_batchpermissionsrequest IS NOT INITIAL.
        lv_identifier = lo_batchpermissionsrequest->get_id( ).
        lo_datalakeprincipal = lo_batchpermissionsrequest->get_principal( ).
        IF lo_datalakeprincipal IS NOT INITIAL.
          lv_datalakeprincipalstring = lo_datalakeprincipal->get_datalakeprincipalid( ).
        ENDIF.
        lo_resource = lo_batchpermissionsrequest->get_resource( ).
        IF lo_resource IS NOT INITIAL.
          lo_catalogresource = lo_resource->get_catalog( ).
          IF lo_catalogresource IS NOT INITIAL.
            lv_catalogidstring = lo_catalogresource->get_id( ).
          ENDIF.
          lo_databaseresource = lo_resource->get_database( ).
          IF lo_databaseresource IS NOT INITIAL.
            lv_catalogidstring = lo_databaseresource->get_catalogid( ).
            lv_namestring = lo_databaseresource->get_name( ).
          ENDIF.
          lo_tableresource = lo_resource->get_table( ).
          IF lo_tableresource IS NOT INITIAL.
            lv_catalogidstring = lo_tableresource->get_catalogid( ).
            lv_namestring = lo_tableresource->get_databasename( ).
            lv_namestring = lo_tableresource->get_name( ).
            lo_tablewildcard = lo_tableresource->get_tablewildcard( ).
            IF lo_tablewildcard IS NOT INITIAL.
            ENDIF.
          ENDIF.
          lo_tablewithcolumnsresourc = lo_resource->get_tablewithcolumns( ).
          IF lo_tablewithcolumnsresourc IS NOT INITIAL.
            lv_catalogidstring = lo_tablewithcolumnsresourc->get_catalogid( ).
            lv_namestring = lo_tablewithcolumnsresourc->get_databasename( ).
            lv_namestring = lo_tablewithcolumnsresourc->get_name( ).
            LOOP AT lo_tablewithcolumnsresourc->get_columnnames( ) into lo_row_2.
              lo_row_3 = lo_row_2.
              IF lo_row_3 IS NOT INITIAL.
                lv_namestring = lo_row_3->get_value( ).
              ENDIF.
            ENDLOOP.
            lo_columnwildcard = lo_tablewithcolumnsresourc->get_columnwildcard( ).
            IF lo_columnwildcard IS NOT INITIAL.
              LOOP AT lo_columnwildcard->get_excludedcolumnnames( ) into lo_row_2.
                lo_row_3 = lo_row_2.
                IF lo_row_3 IS NOT INITIAL.
                  lv_namestring = lo_row_3->get_value( ).
                ENDIF.
              ENDLOOP.
            ENDIF.
          ENDIF.
          lo_datalocationresource = lo_resource->get_datalocation( ).
          IF lo_datalocationresource IS NOT INITIAL.
            lv_catalogidstring = lo_datalocationresource->get_catalogid( ).
            lv_resourcearnstring = lo_datalocationresource->get_resourcearn( ).
          ENDIF.
          lo_datacellsfilterresource = lo_resource->get_datacellsfilter( ).
          IF lo_datacellsfilterresource IS NOT INITIAL.
            lv_catalogidstring = lo_datacellsfilterresource->get_tablecatalogid( ).
            lv_namestring = lo_datacellsfilterresource->get_databasename( ).
            lv_namestring = lo_datacellsfilterresource->get_tablename( ).
            lv_namestring = lo_datacellsfilterresource->get_name( ).
          ENDIF.
          lo_lftagkeyresource = lo_resource->get_lftag( ).
          IF lo_lftagkeyresource IS NOT INITIAL.
            lv_catalogidstring = lo_lftagkeyresource->get_catalogid( ).
            lv_namestring = lo_lftagkeyresource->get_tagkey( ).
            LOOP AT lo_lftagkeyresource->get_tagvalues( ) into lo_row_4.
              lo_row_5 = lo_row_4.
              IF lo_row_5 IS NOT INITIAL.
                lv_lftagvalue = lo_row_5->get_value( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
          lo_lftagpolicyresource = lo_resource->get_lftagpolicy( ).
          IF lo_lftagpolicyresource IS NOT INITIAL.
            lv_catalogidstring = lo_lftagpolicyresource->get_catalogid( ).
            lv_resourcetype = lo_lftagpolicyresource->get_resourcetype( ).
            LOOP AT lo_lftagpolicyresource->get_expression( ) into lo_row_6.
              lo_row_7 = lo_row_6.
              IF lo_row_7 IS NOT INITIAL.
                lv_lftagkey = lo_row_7->get_tagkey( ).
                LOOP AT lo_row_7->get_tagvalues( ) into lo_row_4.
                  lo_row_5 = lo_row_4.
                  IF lo_row_5 IS NOT INITIAL.
                    lv_lftagvalue = lo_row_5->get_value( ).
                  ENDIF.
                ENDLOOP.
              ENDIF.
            ENDLOOP.
            lv_namestring = lo_lftagpolicyresource->get_expressionname( ).
          ENDIF.
          lo_lftagexpressionresource = lo_resource->get_lftagexpression( ).
          IF lo_lftagexpressionresource IS NOT INITIAL.
            lv_catalogidstring = lo_lftagexpressionresource->get_catalogid( ).
            lv_namestring = lo_lftagexpressionresource->get_name( ).
          ENDIF.
        ENDIF.
        LOOP AT lo_batchpermissionsrequest->get_permissions( ) into lo_row_8.
          lo_row_9 = lo_row_8.
          IF lo_row_9 IS NOT INITIAL.
            lv_permission = lo_row_9->get_value( ).
          ENDIF.
        ENDLOOP.
        lo_condition = lo_batchpermissionsrequest->get_condition( ).
        IF lo_condition IS NOT INITIAL.
          lv_expressionstring = lo_condition->get_expression( ).
        ENDIF.
        LOOP AT lo_batchpermissionsrequest->get_permswithgrantoption( ) into lo_row_8.
          lo_row_9 = lo_row_8.
          IF lo_row_9 IS NOT INITIAL.
            lv_permission = lo_row_9->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
      lo_errordetail = lo_row_1->get_error( ).
      IF lo_errordetail IS NOT INITIAL.
        lv_namestring = lo_errordetail->get_errorcode( ).
        lv_descriptionstring = lo_errordetail->get_errormessage( ).
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDIF.