Hi there, Atlassian community!
Anyone who has managed a large Confluence site knows the problem: sensitive pages sit next to public ones, and a consistent way to mark them is missing. Labels get misspelled, statuses are applied inconsistently, and restrictions are set by hand (or forgotten).
In ZeitDocs we have built Classify to fix this. Here is what it does and the design decisions we found most interesting.
What the app does
Users pick a classification level for a page, and the app applies everything that goes with it:
- a label identifying the level
- a content status
- page-level view/edit restrictions, when configured for that level.
Page classification
Behind this are three admin-level features:
- Per-space configuration: each space defines its own classification levels, with names, colors and descriptions.
- Global templates: admins define a template once and apply it to many spaces.
- Reporting: space admins can see which pages have been classified and at what level.
Classification report
Space classification
Global classification
Design decisions that mattered
1. Who is allowed to classify a page?
This was harder than we expected. Space edit permission isn't enough when a page has update restrictions, and Confluence's operations response alone doesn't give the full picture.
So the app handles the two cases differently:
- Unrestricted pages: it checks whether the user has edit permission in the space.
- Restricted pages: it reads the page's update restrictions and checks whether the user is listed directly, belongs to a listed group, or is an administrator.
If the user's identity can't be resolved on a restricted page, the request is denied. We chose to fail closed: in an app about access control, refusing by mistake is better than allowing by mistake.
2. asUser()vs asApp()
Forge lets you call Confluence APIs as the current user or as the app. We use asUser() when the operation should reflect the user's own permissions, such as reading drafts, resolving identity and group membership, or applying restrictions. We use asApp() only where the app's identity is enough, such as reading published content and global spaces.
Sometimes the app can't see a page at all, for example a draft or a page restricted to groups that exclude the app. In those cases we fall back to asUser()explicitly.
3. Don't overwrite restrictions people set by hand
Changing a classification level means changing restrictions, and a naive implementation would wipe whatever was there. Ours doesn't:
- It reads the existing read and update restrictions.
- It identifies the groups the app added for the previous level.
- It removes only those, and adds the groups for the new level.
- Manually added users and groups stay untouched.
It also keeps the acting user in the update restriction, because otherwise Confluence can lock out the person making the change.
4. Enforce policy on the server, not just in the UI
Admins can decide which spaces may use classification: all spaces, only a list of allowed spaces, or all except a list of blocked ones. Bulk operations re-check the policy right before writing, so blocked spaces are skipped, and existing
configurations aren't overwritten unless the admin explicitly forces it.
Take a look at the app and give feedback on what do you think about it!😊😊
Classify- Page Permissions & Visual Security Banners