Show Knowledgebase Articles conditional

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    Show Knowledgebase Articles conditional

    Hi, is there any way to hide Knowledgebase Categories or Articles from certain users/roles?
  • DEN
    Senior Member
    • Apr 2021
    • 106

    #2
    Hi,
    Yes of course,
    Do disabled Knowledgebase Categories in Roles.

    Comment

    • shalmaxb
      Senior Member
      • Mar 2015
      • 1602

      #3
      This way I can disable all categories at once, but I do only want to disable one certain category.

      Comment

      • DEN
        Senior Member
        • Apr 2021
        • 106

        #4
        Pls show me screenshots how it should look.

        Comment

        • shalmaxb
          Senior Member
          • Mar 2015
          • 1602

          #5

          Comment

          • DEN
            Senior Member
            • Apr 2021
            • 106

            #6
            Check the layout manager.

            Comment

            • shalmaxb
              Senior Member
              • Mar 2015
              • 1602

              #7
              Where in the Layout Manager I can configure the category tree view?

              Comment

              • DEN
                Senior Member
                • Apr 2021
                • 106

                #8
                Categories allow to group articles. One category can contain multiple sub-categories. Each article can be related to one or multiple categories.

                Knowledge Base Category is a separate entity type, hence an access can be controlled by ACL Roles.

                Comment

                • shalmaxb
                  Senior Member
                  • Mar 2015
                  • 1602

                  #9
                  Or I do not get something or this statement is not true for my case. I want to disable only one category, no problem if it would be possible with role permission. But the category entity is an entity for ALL categories, so I can disable all, but not one specific. Am I wrong?

                  Comment

                  • DEN
                    Senior Member
                    • Apr 2021
                    • 106

                    #10
                    The ability to remove one category exists, but I don’t think to hide.
                    You can hide an element on the "list view" but not the "records" or "categories".

                    And how do you like the option to deleted the category?
                    Manage category > Remove

                    Comment

                    • shalmaxb
                      Senior Member
                      • Mar 2015
                      • 1602

                      #11
                      Now I got it. The only way to hide or show either knowledgebase articles or categories is from Team.

                      Let´s say you have categories A, B and C

                      You want team 1 see only A and B, and team 2 only B and C

                      In every category you choose the team (in the side panel), which can see the category. In the example case it would be:
                      In category A you associate team 1
                      In category B you associate team 1 and team 2
                      In category C you associate team 2

                      For single articles it is the same procedure. Admin has always acces to all categories and articles.
                      Last edited by shalmaxb; 05-12-2021, 11:26 AM.

                      Comment

                      • dimyy
                        Active Community Member
                        • Jun 2018
                        • 569

                        #12
                        You can try:

                        0. Create 2 groups: "without wordpress integration" and "full access"
                        1. Assign "without wordpress integration" to all categories except "wordpress integration" category .
                        2. Edit "without wordpress integration" user role to grant "group" read access to knowledgebase category
                        3. Assign "without wordpress integration" groups to users without access to "wordpress integration" category.
                        4. Edit "full access" user role to grant "all" read access to knowledgebase category
                        5. Assign "full access" to all users except "without wordpress integration" users

                        Another way:
                        Make program customization like this:

                        PHP Code:
                        <?php
                        
                        namespace Espo\Custom\Acl;
                        
                        use Espo\ORM\Entity;
                        
                        class KnowledgeBaseCategory extends \Espo\Core\Acl\Base
                        {
                        
                        public function checkEntityRead(User $user, Entity $entity, $data)
                        {
                        if ($this->isProtectedCategory($user, $entity, $data)) {
                        return false;
                        }
                        
                        return parent::checkEntityRead($user, $entity, $data);
                        }
                        
                        public function isProtectedCategory(User $user, Entity $entity, $data)
                        {
                        }
                        
                        }
                        Attached Files

                        Comment


                        • shalmaxb
                          shalmaxb commented
                          Editing a comment
                          Thank you, posted the solution that same moment.
                      Working...