/AWS1/IF_VPS=>ISAUTHORIZED()¶
About IsAuthorized¶
Makes an authorization decision about a service request described in the parameters. The information in the parameters can also define additional context that Verified Permissions can include in the evaluation. The request is evaluated against all matching policies in the specified policy store. The result of the decision is either Allow or Deny, along with a list of the policies that resulted in the decision.
Method Signature¶
METHODS /AWS1/IF_VPS~ISAUTHORIZED
IMPORTING
!IV_POLICYSTOREID TYPE /AWS1/VPSPOLICYSTOREID OPTIONAL
!IO_PRINCIPAL TYPE REF TO /AWS1/CL_VPSENTITYIDENTIFIER OPTIONAL
!IO_ACTION TYPE REF TO /AWS1/CL_VPSACTIONIDENTIFIER OPTIONAL
!IO_RESOURCE TYPE REF TO /AWS1/CL_VPSENTITYIDENTIFIER OPTIONAL
!IO_CONTEXT TYPE REF TO /AWS1/CL_VPSCONTEXTDEFINITION OPTIONAL
!IO_ENTITIES TYPE REF TO /AWS1/CL_VPSENTITIESDEFINITION OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_vpsisauthorizedoutput
RAISING
/AWS1/CX_VPSACCESSDENIEDEX
/AWS1/CX_VPSINTERNALSERVEREX
/AWS1/CX_VPSTHROTTLINGEX
/AWS1/CX_VPSVALIDATIONEX
/AWS1/CX_VPSRESOURCENOTFOUNDEX
/AWS1/CX_VPSCLIENTEXC
/AWS1/CX_VPSSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_policystoreid TYPE /AWS1/VPSPOLICYSTOREID /AWS1/VPSPOLICYSTOREID¶
Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input.
Optional arguments:¶
io_principal TYPE REF TO /AWS1/CL_VPSENTITYIDENTIFIER /AWS1/CL_VPSENTITYIDENTIFIER¶
Specifies the principal for which the authorization decision is to be made.
io_action TYPE REF TO /AWS1/CL_VPSACTIONIDENTIFIER /AWS1/CL_VPSACTIONIDENTIFIER¶
Specifies the requested action to be authorized. For example, is the principal authorized to perform this action on the resource?
io_resource TYPE REF TO /AWS1/CL_VPSENTITYIDENTIFIER /AWS1/CL_VPSENTITYIDENTIFIER¶
Specifies the resource for which the authorization decision is to be made.
io_context TYPE REF TO /AWS1/CL_VPSCONTEXTDEFINITION /AWS1/CL_VPSCONTEXTDEFINITION¶
Specifies additional context that can be used to make more granular authorization decisions.
io_entities TYPE REF TO /AWS1/CL_VPSENTITIESDEFINITION /AWS1/CL_VPSENTITIESDEFINITION¶
(Optional) Specifies the list of resources and principals and their associated attributes that Verified Permissions can examine when evaluating the policies. These additional entities and their attributes can be referenced and checked by conditional elements in the policies in the specified policy store.
You can include only principal and resource entities in this parameter; you can't include actions. You must specify actions in the schema.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_vpsisauthorizedoutput /AWS1/CL_VPSISAUTHORIZEDOUTPUT¶
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->isauthorized(
io_action = new /aws1/cl_vpsactionidentifier(
iv_actionid = |string|
iv_actiontype = |string|
)
io_context = new /aws1/cl_vpscontextdefinition(
it_contextmap = VALUE /aws1/cl_vpsattributevalue=>tt_contextmap(
(
VALUE /aws1/cl_vpsattributevalue=>ts_contextmap_maprow(
value = new /aws1/cl_vpsattributevalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
it_record = VALUE /aws1/cl_vpsattributevalue=>tt_recordattribute(
(
VALUE /aws1/cl_vpsattributevalue=>ts_recordattribute_maprow(
value = new /aws1/cl_vpsattributevalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
it_set = VALUE /aws1/cl_vpsattributevalue=>tt_setattribute(
(
new /aws1/cl_vpsattributevalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
)
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
key = |string|
)
)
)
it_set = VALUE /aws1/cl_vpsattributevalue=>tt_setattribute(
(
new /aws1/cl_vpsattributevalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
it_record = VALUE /aws1/cl_vpsattributevalue=>tt_recordattribute(
(
VALUE /aws1/cl_vpsattributevalue=>ts_recordattribute_maprow(
value = new /aws1/cl_vpsattributevalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
key = |string|
)
)
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
)
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
key = |string|
)
)
)
iv_cedarjson = |string|
)
io_entities = new /aws1/cl_vpsentitiesdefinition(
it_entitylist = VALUE /aws1/cl_vpsentityitem=>tt_entitylist(
(
new /aws1/cl_vpsentityitem(
io_identifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
it_attributes = VALUE /aws1/cl_vpsattributevalue=>tt_entityattributes(
(
VALUE /aws1/cl_vpsattributevalue=>ts_entityattributes_maprow(
value = new /aws1/cl_vpsattributevalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
it_record = VALUE /aws1/cl_vpsattributevalue=>tt_recordattribute(
(
VALUE /aws1/cl_vpsattributevalue=>ts_recordattribute_maprow(
value = new /aws1/cl_vpsattributevalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
it_set = VALUE /aws1/cl_vpsattributevalue=>tt_setattribute(
(
new /aws1/cl_vpsattributevalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
)
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
key = |string|
)
)
)
it_set = VALUE /aws1/cl_vpsattributevalue=>tt_setattribute(
(
new /aws1/cl_vpsattributevalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
it_record = VALUE /aws1/cl_vpsattributevalue=>tt_recordattribute(
(
VALUE /aws1/cl_vpsattributevalue=>ts_recordattribute_maprow(
value = new /aws1/cl_vpsattributevalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
key = |string|
)
)
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
)
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
key = |string|
)
)
)
it_parents = VALUE /aws1/cl_vpsentityidentifier=>tt_parentlist(
(
new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
)
)
it_tags = VALUE /aws1/cl_vpscedartagvalue=>tt_entitycedartags(
(
VALUE /aws1/cl_vpscedartagvalue=>ts_entitycedartags_maprow(
value = new /aws1/cl_vpscedartagvalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
it_record = VALUE /aws1/cl_vpscedartagvalue=>tt_cedartagrecordattribute(
(
VALUE /aws1/cl_vpscedartagvalue=>ts_cedartagrecordattr_maprow(
key = |string|
value = new /aws1/cl_vpscedartagvalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
it_set = VALUE /aws1/cl_vpscedartagvalue=>tt_cedartagsetattribute(
(
new /aws1/cl_vpscedartagvalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
)
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
)
)
)
it_set = VALUE /aws1/cl_vpscedartagvalue=>tt_cedartagsetattribute(
(
new /aws1/cl_vpscedartagvalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
it_record = VALUE /aws1/cl_vpscedartagvalue=>tt_cedartagrecordattribute(
(
VALUE /aws1/cl_vpscedartagvalue=>ts_cedartagrecordattr_maprow(
key = |string|
value = new /aws1/cl_vpscedartagvalue(
io_entityidentifier = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
)
)
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
)
)
iv_boolean = ABAP_TRUE
iv_datetime = |string|
iv_decimal = |string|
iv_duration = |string|
iv_ipaddr = |string|
iv_long = 123
iv_string = |string|
)
key = |string|
)
)
)
)
)
)
iv_cedarjson = |string|
)
io_principal = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
io_resource = new /aws1/cl_vpsentityidentifier(
iv_entityid = |string|
iv_entitytype = |string|
)
iv_policystoreid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_decision = lo_result->get_decision( ).
LOOP AT lo_result->get_determiningpolicies( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_policyid = lo_row_1->get_policyid( ).
ENDIF.
ENDLOOP.
LOOP AT lo_result->get_errors( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_string = lo_row_3->get_errordescription( ).
ENDIF.
ENDLOOP.
ENDIF.
IsAuthorized - Example 1¶
The following example requests an authorization decision for a principal of type User named Alice, who wants to perform the updatePhoto operation, on a resource of type Photo named VacationPhoto94.jpg.
The response shows that the request was allowed by one policy.
DATA(lo_result) = lo_client->isauthorized(
io_action = new /aws1/cl_vpsactionidentifier(
iv_actionid = |view|
iv_actiontype = |Action|
)
io_principal = new /aws1/cl_vpsentityidentifier(
iv_entityid = |alice|
iv_entitytype = |User|
)
io_resource = new /aws1/cl_vpsentityidentifier(
iv_entityid = |VacationPhoto94.jpg|
iv_entitytype = |Photo|
)
iv_policystoreid = |C7v5xMplfFH3i3e4Jrzb1a|
).
IsAuthorized - Example 2¶
The following example is the same as the previous example, except that the principal is User::"bob", and the policy store doesn't contain any policy that allows that user access to Album::"alice_folder". The output infers that the Deny was implicit because the list of DeterminingPolicies is empty.
DATA(lo_result) = lo_client->isauthorized(
io_action = new /aws1/cl_vpsactionidentifier(
iv_actionid = |view|
iv_actiontype = |Action|
)
io_principal = new /aws1/cl_vpsentityidentifier(
iv_entityid = |bob|
iv_entitytype = |User|
)
io_resource = new /aws1/cl_vpsentityidentifier(
iv_entityid = |VacationPhoto94.jpg|
iv_entitytype = |Photo|
)
iv_policystoreid = |C7v5xMplfFH3i3e4Jrzb1a|
).