Customize the Role Manager tool in Sitecore
In Sitecore, roles are the preferred way of managing access to resources. The beauty of roles lies in their ability to shield the administrators from the complexities of security and user management, so instead of spending hours setting up individual accounts with specific rights and remembering these combinations, administrators can simply create a role, define the level of access and start adding users, groups, or even other roles to it. Simple and effective.
The preferred tool for the job is the
Role Manager screen (see below).
Unfortunately, this tool is far from perfect... so let's do something about it.
The first thing you will notice is that sorting is disabled (the cursor changing
pointer gives it away). Perhaps this was done on purpose, trying
to encourage users to use of the search bar instead of doing manual searches;
perhaps it was an oversight. I honestly don't know... What I do know is that
there are times when people don't really know the specific role they are looking for,
but they at least know the domain in which the role was defined. In this type of
scenarios sorting proves to be an excellent way of finding the required information.
Depending on the desired options, customizing the
Role Manager will require one
or more updates to one of the Sitecore core files (files that come with Sitecore
out of the box).
Messing around with core files is not recommended, so take the necessary precautions. I would recommend creating backups of all files before proceeding.
The file in question is:
Re-enabling sorting is as easy as setting the property
This property is defined independently per column and can be found in the
Grid\Levels\GridLevel\Columns node definition (see below).
|<ca:GridColumn DataField="scGridID" Visible="false" />|
|<ca:GridColumn DataField="Name" Visible="false" />|
Show/Hide the search bar
Another easy one... the property
Grid will show the search box
when its value is set to
true and will do the opposite when set to
And the end result...
Change the pager style
Customizing the pager requires a little more effort (but not a lot). The final
style and behavior of the pager will depend on a combination of settings and
styles. Of all the available settings the most important is perhaps the
PagerStyle will determine the type of pager to be used. Valid options for
this property are
Numbered (see image below) and
(the buttons from
Slider minus the slider). There are a bunch of other properties
that don't seem to have any effect on the final output, I think most of the styling
is controlled via the
Grid.css stylesheet (which of course can be extended).
And the end result...
There are a lot more things that can be customized in the tool, some might not make a lot of sense (like completely hiding the header), but others will definitely improve the overall user experience.
What else do you think is missing or would you like to see in this tool?