Kernel::WebApp::Controller::API::Role::ChecksGroupAccess

NAME

Kernel::WebApp::Controller::API::Role::ChecksGroupAccess – Check endpoint group access permission.

PUBLIC INTERFACE

Consume this role to be able to check read and write or read only group access.

GroupAccessGranted()

This method checks given groups against user read and write groups, return true on the first group that matches

    my $Success = $Self->GroupAccessGranted('some-group');

or

    $Success = $Self->GroupAccessGranted( ['some-group', 'some-other-group'] );

Result:

    $Success = 1;   # or false in case of no match

GroupROAccessGranted()

This method checks given groups against user read only groups, return true on the first group that matches

    my $Success = $Self->GroupROAccessGranted('some-group');

or

    $Success = $Self->GroupROAccessGranted( ['some-group', 'some-other-group'] );

Result:

    $Success = 1;   # or false in case of no match

PRIVATE INTERFACE

_BuildGroupAccess()

This is a helper method used to populate has 'GroupAccess' property.

    my %Groups = $Self->_BuildGroupAccess();

_BuildGroupROAccess()

This is a helper method used to populate has 'GroupROAccess' property.

    my %Groups = $Self->_BuildGroupROAccess();

_ProcessGroupAccess()

This is a helper method id used by public methods 'GroupAccessGranted' and 'GroupROAccessGranted', checks given groups match the ones stored in properties 'GroupAccess' and 'GroupROAccess' accordingly by the given Type parameter.

    my $Success = $Self->_ProcessGroupAccess(
        TargetGroups => ['some group'],
        Type         => 'ro',           # or 'rw'
    );

Result:

    $Success = 1;   # or false in case of no match
Scroll to Top