Show TOC

 Example of the Implementation of HRPAD00AUTH_CHECK

PRIVATE SECTION.

DATA a_auth_check TYPE REF TO if_ex_hrpad00auth_check.

METHOD if_ex_hrpad00auth_check~check_max_infty_authorization.

CALL METHOD a_auth_check->check_max_infty_authorization

EXPORTING

level = level

tclas = tclas

infty = infty

IMPORTING

is_authorized = is_authorized

EXCEPTIONS

internal_error = 1

invalid = 2.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE invalid.

ENDCASE.

ENDMETHOD.

METHOD if_ex_hrpad00auth_check~check_max_level_authorization.

CALL METHOD a_auth_check->check_max_level_authorization

EXPORTING

level = level

tclas = tclas

IMPORTING

is_authorized = is_authorized

EXCEPTIONS

internal_error = 1

invalid = 2.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE invalid.

ENDCASE.

ENDMETHOD.

METHOD if_ex_hrpad00auth_check~check_max_subty_authorization.

CALL METHOD a_auth_check->check_max_subty_authorization

EXPORTING

level = level

tclas = tclas

infty = infty

subty = subty

IMPORTING

is_authorized = is_authorized

EXCEPTIONS

invalid = 2

internal_error = 1.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE invalid.

ENDCASE.

ENDMETHOD.

METHOD if_ex_hrpad00auth_check~check_min_infty_authorization.

CALL METHOD a_auth_check->check_min_infty_authorization

EXPORTING

level = level

tclas = tclas

infty = infty

IMPORTING

is_authorized = is_authorized

EXCEPTIONS

internal_error = 1

invalid = 2.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE invalid.

ENDCASE.

ENDMETHOD.

METHOD if_ex_hrpad00auth_check~check_min_level_authorization.

CALL METHOD a_auth_check->check_min_level_authorization

EXPORTING

level = level

tclas = tclas

IMPORTING

is_authorized = is_authorized

EXCEPTIONS

internal_error = 1

invalid = 2.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE invalid.

ENDCASE.

ENDMETHOD.

METHOD if_ex_hrpad00auth_check~check_min_subty_authorization.

CALL METHOD a_auth_check->check_min_subty_authorization

EXPORTING

level = level

tclas = tclas

infty = infty

subty = subty

IMPORTING

is_authorized = is_authorized

EXCEPTIONS

invalid = 2

internal_error = 1.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE invalid.

ENDCASE.

ENDMETHOD.

METHOD if_ex_hrpad00auth_check~set_org_assignment.

CALL METHOD a_auth_check->set_org_assignment

EXPORTING

tclas = tclas

p0001_tab = p0001_tab

EXCEPTIONS

invalid = 2

internal_error = 1.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE invalid.

ENDCASE.

ENDMETHOD.

METHOD if_ex_hrpad00auth_check~set_partial_org_assignment.

CALL METHOD a_auth_check->set_partial_org_assignment

EXPORTING

tclas = tclas

p0001 = p0001

fieldlist = fieldlist

EXCEPTIONS

invalid = 2

internal_error = 1.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE invalid.

ENDCASE.

ENDMETHOD.

METHOD if_ex_hrpad00auth_check~check_authorization.

DATA l_begda TYPE begda.

DATA l_endda TYPE endda.

IF level CA 'R M'.

* read access --> alter data to get nonstandard behaviour

l_begda = sy-datum.

l_endda = sy-datum.

ELSE.

* write access --> standard timelogik applies

l_begda = begda.

l_endda = endda.

ENDIF.

CALL METHOD a_auth_check->check_authorization

EXPORTING

level = level

tclas = tclas

pernr = pernr

infty = infty

subty = subty

begda = l_begda

endda = l_endda

process_only_partial_checks = process_only_partial_checks

IMPORTING

is_authorized = is_authorized

EXCEPTIONS

invalid = 2

internal_error = 1.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE invalid.

ENDCASE.

ENDMETHOD.

METHOD if_ex_hrpad00auth_check~check_max_pernr_authorization.

CALL METHOD a_auth_check->check_max_pernr_authorization

EXPORTING

level = level

tclas = tclas

pernr = pernr

IMPORTING

is_authorized = is_authorized

EXCEPTIONS

invalid = 2

internal_error = 1.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE invalid.

ENDCASE.

ENDMETHOD.

METHOD if_ex_hrpad00auth_check~check_min_pernr_authorization.

CALL METHOD a_auth_check->check_min_pernr_authorization

EXPORTING

level = level

tclas = tclas

pernr = pernr

IMPORTING

is_authorized = is_authorized

EXCEPTIONS

invalid = 2

internal_error = 1.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE invalid.

ENDCASE.

ENDMETHOD.

METHOD if_ex_hrpad00auth_check~check_pernr_authorization.

DATA l_begda TYPE begda.

DATA l_endda TYPE endda.

IF level CA 'R M'.

* read access --> alter data to get nonstandard behaviour

l_begda = sy-datum.

l_endda = sy-datum.

ELSE.

* write access --> standard timelogik applies

l_begda = begda.

l_endda = endda.

ENDIF.

CALL METHOD a_auth_check->check_pernr_authorization

EXPORTING

level = level

tclas = tclas

pernr = pernr

begda = begda

endda = endda

IMPORTING

is_authorized = is_authorized

EXCEPTIONS

invalid = 2

internal_error = 1.

CASE sy-subrc.

WHEN 1.

RAISE internal_error.

WHEN 2.

RAISE invalid.

ENDCASE.

ENDMETHOD.

METHOD if_ex_hrpad00auth_check~delayed_constructor.

ENDMETHOD.

METHOD constructor.

CREATE OBJECT a_auth_check TYPE cl_hrpad00auth_check_std.

ENDMETHOD.