# How do Data Category Visibility rules enforce secure content segmentation for different user tiers?

**Topic:** Service Cloud · **Difficulty:** Medium · **Tags:** Service Cloud, Category Visibility, Security Rules

Read it on the site: https://www.forcechallenges.com/interview-questions/how-do-data-category-visibility-rules-enforce-secure-content-segmentation-for-different-user-tiers

## Answer

**Basics:** Data categories are hierarchies (for example Product > Laptops, Region > EMEA) within Data Category Groups. Each article is tagged with categories. Visibility settings say which categories a user may see: all, none, or a custom selection. An article appears for a user only if they can see at least one category of the article in each group the article is classified in.

**How it works:** Setup > Data Categories > create groups and categories (up to five active groups, up to five levels deep and 100 categories per group; verify current limits). Then Data Category Visibility is set on Roles (default for users in that role), Profiles and Permission Sets. Selecting a parent category exposes its children. For Experience Cloud users, visibility comes from the site user's role (where applicable), profile or permission sets, and for guests the guest profile. Combine with channel and object permissions for final visibility.

**Advanced / deep dive:** Visibility from multiple sources combines additively, so a permissive permission set can widen access; audit with care and test as the target user using Login As or the Knowledge search as that user. Mapping tiers: Free, Premium and Partner can be modeled as categories, with each tier's permission set granting its subtree. In SOQL and SOSL use `WITH DATA CATEGORY` with `AT`, `ABOVE`, `BELOW`, `ABOVE_OR_BELOW` to filter explicitly. Category visibility applies even in Apex running with sharing, but system-mode code can bypass it, so design service classes carefully. Moving categories in the hierarchy changes inherited visibility, so change control is needed. Behavior for articles with no category in a group is worth verifying in your org before relying on it.

**Code / config example:**
```sql
SELECT Id, Title
FROM Knowledge__kav
WHERE PublishStatus = 'Online' AND Language = 'en_US'
WITH DATA CATEGORY Product__c BELOW Laptops__c
  AND Region__c AT EMEA__c
```

**Hidden gotchas & must-remember points:**
- Category visibility is separate from record sharing; both Read permission and categories must permit access.
- Choosing a parent category implicitly exposes all children, which people often forget.
- Role visibility is a default; permission sets can add to it.
- Maximum five active category groups; plan taxonomy early.
- Guests need category visibility on the guest user profile, or the public knowledge base looks empty.
- Changing visibility does not change channels; an article can pass categories yet still be hidden by channel.

**Best practice:** Map categories to audience tiers, grant access using permission sets, and test each tier with a sample user before launch.

---
Source: ForceChallenges · last updated 2026-11-02
