Add permission templates and descriptions

This function is used to add a description to permission groups to make it easier for admins to understand how each group is used. It also allows to add templates so that an admin can select a template and get the permissions set according to that template.

Version 4.3

This function is available in version 4.3 and later.

Overview

The function will add a section in the user administration view. The section will display the permission groups and a description for each group. 

The function will also allow to define a set of templates that an admin may use. Selecting a template will push the permission groups of that template to the user. If admin manually selects other permission groups the template drop down will instead show Custom. If the manually added permissions matches any of the templates in the drop down, that template will be shown.

Configuration

Permission templates and descriptions are defined in profile.config.

PermissionTemplates defines a set of permissions (groups) that may be applied to a user. This is just a short cut to make it easier for admin to apply the right permissions. Sample:

<PermissionTemplates>    <PermissionTemplate>       <Name>Default Permission</Name>       <GroupNames>PlaceOrder</GroupNames>    </PermissionTemplate>    <PermissionTemplate>       <Name>Customer</Name>       <GroupNames>PlaceOrder,Price,Availability,EditShippingAddress</GroupNames>    </PermissionTemplate>    <PermissionTemplate>       <Name>Custom</Name>       <GroupNames>Custom</GroupNames>    </PermissionTemplate> </PermissionTemplates>

PermissionGroups defines descriptions to each group to be displayed in the web viewer. These descriptions are only used to make it easier for end users to understand the effect of each group. Sample:

<PermissionGroups>    <PermissionGroup>       <Name>Administrators</Name>       <Description>Can admister ecom, see prices, callcentre, place order</Description>    </PermissionGroup>    <PermissionGroup>       <Name>CallCenter</Name>       <Description>Can use call centre function, see prices/availability</Description>    </PermissionGroup> </PermissionGroups>