Kernel::WebApp::Controller::API::Role::ChecksKnowledgeBasePermission

NAME

Kernel::WebApp::Controller::API::Role::ChecksKnowledgeBasePermission – Check permission for the current knowledge base article or category.

PUBLIC INTERFACE

Consume this role to be able to check if the current endpoint can be used according to knowledge base permissions. It works by wrapping a default implementation around Kernel::WebApp::Controller::API::Base::Authorize().

You can still provide your own Authorize() method to perform additional checks in the endpoint.

KnowledgeBaseCategoryID()

This method provides the CategoryID to be used for the permission check. The default implementation fetch it from the :CategoryID param value.

You can override the default implementation of this attribute to specify a different source for the CategoryID to test.

    sub KnowledgeBaseCategoryID {
        # provide custom implementation that return an C<Scalar> of C<CategoryID>.
        return $Self->stash('CategoryID');
    }

KnowledgeBaseArticleID()

This method provides the ArticleID to be used for the permission check. The default implementation fetch it from the :ArticleID param value.

You can override the default implementation of this attribute to specify a different source for the ArticleID to test.

    sub KnowledgeBaseArticleID {
        # provide custom implementation that return an C<Scalar> of C<ArticleID>.
        return $Self->stash('ArticleID');
    }
Scroll to Top