Web Sites Menu Filtering

October 13, 2009

This year at Oracle OpenWorld 2009, I presented a session on leveraging digital asset management with Site Studio 10gR4. During that session I briefly showed the website's menu in UCM. I discussed how one might restrict the list of sites in that menu per user. This video demonstrates that ability.

First let's get logged into Content Server. Now let's go take a look at the installed component in the Admin Server. Now that we've seen that the component's installed, let's go over to Admin Applets and look at the various things we can do, like adding a role. In this example, we'll show a role that's been created to view the PayPal demo site. Adding this role with a certain naming convention operates with the component to allow us to say who can see which sites.

As system admin, if we go look at the website's list, we see all the sites. Now let's log out and get logged back in as SingleSiteGuy who is our user to demonstrate seeing only one site. Finally we see in the website's list, only one link.

I am starting to release some of the example components demonstrated at my session this year at Oracle OpenWorld 2009. In the demo I briefly showed the Web Sites menu and talked about filtering the sites in this menu based on UCM Roles. This component demonstrates how one might accomplish such a task. As other articles related to my session come on line I will inter-link them together.

You know that Web Sites menu Site Studio adds to Content Server? Can I limit the links in that list somehow? This question is asked fairly regularly. I wanted to get a sample of how one might accomplish just that out for general consumption. Once you see an example accomplishing the filtering of that list you’ll be able to apply your own specific business logic as well.

In this example we’re going to use Roles to control what web sites are listed in the menu for any given user. I’ve seen this list controlled by Roles, Accounts, Custom User Metadata and every combination of those aspects and more. This is a LOT less about securing sites away from the users (as it doesn’t do that AT ALL) and more about thinning the sites list to something more context appropriate for individuals attempting to do their everyday job.

How to do this? Override the custom_finish_layout_init dynamic html include. Here’s the important snippet (don’t worry, there is an example component!):

<$c=" STARTING EDIT HERE, JS"$> <$if UserIsAdmin OR userHasRole("SSMENU" & siteId)$> navBuilder.addChildNodeTo('SS_DISPLAY_WEBSITES' , 'item' , 'id==SS_WEBSITE_<$n$>' , 'label==<$js(label)$>' , 'url==<$js(siteRef)$>' , 'icon==WebItem.gif'); <$endif$> <$c=" ENDING EDIT HERE, JS"$> So, sysadmin has the admin role, so s/he can see our three site samples in the web sites list: Now, pretend we’ve created a new user named SingleSiteGuy (stay on task here, this is not a dating site side story…). We’ll give SingleSiteGuy our new SSMENUPayPalDemo Role. And TA DA! Now SingleSiteGuy can only see the menu we gave him a role to access. Grab the Websites Menu Filter Sample Component.

© 2020 Jason Stortz (version 20200607-210013)