THE ISSUE
An Ektron CMS400 question came in over twitter the other day that I found particularly interesting. A user was wondering if it is possible to apply permissions to a taxonomy node in Ektron. My first thought is that by default in Ektron, the content in any taxonomy is permissioned, so why would you need to add permissions to an entire taxonomy node? The problem was that the user wasn't trying to permission the content itself (because it is already permissioned at the folder level), they were trying to grant permissions to see a taxonomy node in a list.
THE EXAMPLE
Let’s say I had a taxonomy driven list of document categories (IT, Accounting, Employees, and Payroll), and the content under the Payroll taxonomy node is permissioned at the folder level. When I click on the link for payroll, I get the following message "No documents available" because I don't have permission to view those items. The issue is that the user would actually have to click the taxonomy node before they found out they did not have the correct permissions to view the content. So basically the question has become, how can I hide a taxonomy node if the user does not have the right to view the content under it?
THE SOLUTION
This answer is fairly complex but I will discuss it at a high level with bullet points.
- The first thing you need to do is sync the taxonomy back to a folder. The reason for this is because you want to be able to pull that permissions based on the folder the content is synced to. NOTE: this only works if you permission content on a folder by folder basis.
- Once you have the taxonomy synced, you can then use the Ektron API to get the folder ID each taxonomy node is synced to.
- Once you have the folder ID, you can then use the Ektron Member API to find out if the user has permissions to view the content in that folder.
- If not, do not show the taxonomy Node in the taxonomy list.
Hopefully that helps. Happy Holidays!