Class AuthorizationManagerImpl

    • Constructor Detail

      • AuthorizationManagerImpl

        public AuthorizationManagerImpl​(org.kie.internal.identity.IdentityProvider identityProvider,
                                        TransactionalCommandService commandService)
    • Method Detail

      • isEnabled

        public boolean isEnabled()
      • setEnabled

        public void setEnabled​(boolean enabled)
      • buildAuthorizationConfig

        protected void buildAuthorizationConfig()
      • verifyAuthorization

        protected void verifyAuthorization​(String caseId,
                                           List<String> authorizedEntities,
                                           String errorMessage)
      • collectUserAuthInfo

        protected List<String> collectUserAuthInfo()
      • filterByDataAuthorization

        public Map<String,​Object> filterByDataAuthorization​(String caseId,
                                                                  CaseFileInstance caseFileInstance,
                                                                  Map<String,​Object> data)
        Description copied from interface: AuthorizationManager
        Filters provided data by data restrictions. This guarantees only data authorized for given user will be returned.
        Specified by:
        filterByDataAuthorization in interface AuthorizationManager
        Parameters:
        caseId - unique id of the case
        caseFileInstance - case file associated with given case instance
        data - actual data to be filtered
        Returns:
        returns filtered map of data if any restriction applied
      • checkDataAuthorization

        public void checkDataAuthorization​(String caseId,
                                           CaseFileInstance caseFileInstance,
                                           Collection<String> dataNames)
        Description copied from interface: AuthorizationManager
        Check if caller (based on identity provider) is authorized to manipulate given data
        Specified by:
        checkDataAuthorization in interface AuthorizationManager
        Parameters:
        caseId - unique id of the case
        caseFileInstance - case file associated with given case instance
        dataNames - data names to be manipulated/put into the case instance
      • filterByCommentAuthorization

        public List<CommentInstance> filterByCommentAuthorization​(String caseId,
                                                                  CaseFileInstance caseFileInstance,
                                                                  List<CommentInstance> comments)
        Description copied from interface: AuthorizationManager
        Filters provided comments by their restrictions. This guarantees only comments authorized to be seen by user will be returned.
        Specified by:
        filterByCommentAuthorization in interface AuthorizationManager
        Parameters:
        caseId - unique id of the case
        caseFileInstance - case file associated with given case instance
        comments - comments to be filtered
        Returns:
        filtered comments if any restrictions applied or same as given as argument
      • checkCommentAuthorization

        public void checkCommentAuthorization​(String caseId,
                                              CaseFileInstance caseFileInstance,
                                              CommentInstance commentInstance)
        Description copied from interface: AuthorizationManager
        Check if caller (based on identity provider) is authorized to manipulate given comment
        Specified by:
        checkCommentAuthorization in interface AuthorizationManager
        Parameters:
        caseId - unique id of the case
        caseFileInstance - case file associated with given case instance
        commentInstance - comment that is about to be manipulated (updated or removed)
      • loggedInAsSystemUser

        protected boolean loggedInAsSystemUser()