<commit_before>*&---------------------------------------------------------------------*
*&  Include           ZABAPGIT_AUTHORIZATIONS
*&---------------------------------------------------------------------*

TYPES: ty_activity TYPE string.

CONSTANTS: BEGIN OF gc_activities,
             uninstall TYPE ty_activity VALUE 'UNINSTALL',
           END OF gc_activities.

INTERFACE lif_auth.
  METHODS:
    is_allowed
      IMPORTING iv_activity       TYPE ty_activity
      RETURNING VALUE(rv_allowed) TYPE abap_bool.
ENDINTERFACE.

* implement class LCL_AUTH_EXIT implementing LIF_AUTH in following include,
* place the include in a different package than ZABAPGIT
INCLUDE zabapgit_authorizations_exit IF FOUND.

*******************

CLASS lcl_auth DEFINITION FINAL.

  PUBLIC SECTION.
    CLASS-METHODS:
      is_allowed
        IMPORTING iv_activity       TYPE ty_activity
        RETURNING VALUE(rv_allowed) TYPE abap_bool.

ENDCLASS.

CLASS lcl_auth IMPLEMENTATION.

  METHOD is_allowed.

    DATA: li_auth TYPE REF TO lif_auth.

    TRY.
        CREATE OBJECT li_auth TYPE ('LCL_AUTH_EXIT').
        rv_allowed = li_auth->is_allowed( iv_activity ).
      CATCH cx_sy_create_object_error.
        rv_allowed = abap_true.
    ENDTRY.

  ENDMETHOD.

ENDCLASS.<commit_msg>add param<commit_after>*&---------------------------------------------------------------------*
*&  Include           ZABAPGIT_AUTHORIZATIONS
*&---------------------------------------------------------------------*

TYPES: ty_activity TYPE string.

CONSTANTS: BEGIN OF gc_activities,
             uninstall TYPE ty_activity VALUE 'UNINSTALL',
           END OF gc_activities.

INTERFACE lif_auth.
  METHODS:
    is_allowed
      IMPORTING iv_activity       TYPE ty_activity
                iv_param          TYPE string OPTIONAL
      RETURNING VALUE(rv_allowed) TYPE abap_bool.
ENDINTERFACE.

* implement class LCL_AUTH_EXIT implementing LIF_AUTH in following include,
* place the include in a different package than ZABAPGIT
INCLUDE zabapgit_authorizations_exit IF FOUND.

*******************

CLASS lcl_auth DEFINITION FINAL.

  PUBLIC SECTION.
    CLASS-METHODS:
      is_allowed
        IMPORTING iv_activity       TYPE ty_activity
                  iv_param          TYPE string OPTIONAL
        RETURNING VALUE(rv_allowed) TYPE abap_bool.

ENDCLASS.

CLASS lcl_auth IMPLEMENTATION.

  METHOD is_allowed.

    DATA: li_auth TYPE REF TO lif_auth.

    TRY.
        CREATE OBJECT li_auth TYPE ('LCL_AUTH_EXIT').
        rv_allowed = li_auth->is_allowed( iv_activity = iv_activity
                                          iv_param    = iv_param ).
      CATCH cx_sy_create_object_error.
        rv_allowed = abap_true.
    ENDTRY.

  ENDMETHOD.

ENDCLASS.
{'fraction_non_alphanumeric': 0.15891614793116074, 'fraction_numerical': 0.0, 'mean_word_length': 1.8818565400843883, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7542228', 'n_tokens_mistral': 820, 'n_tokens_neox': 777, 'n_words': 205}