Roles
Domain security can reference a user’s roles to determine the access permissions to grant. The following roles meet CZS’s needs:
• | ROLE_SALES_MANAGER is assigned to sales managers. |
• | ROLE_SALES_REP is assigned to sales representatives. |
CZS grants each role access to view the Sales Domain. For details about creating roles and assigning privileges, refer to the JasperReports Server Administrator Guide. The following shows CZS’s ROLE_SALES_REP:
|
CZS Sales Representative Role |
Users
CZS created a user for each of their employees and assigned roles based on each employee’s level of responsibility:
User |
Role |
Alexi |
ROLE_SALES_MANAGER |
Pete |
ROLE_SALES_REP |
Rita |
ROLE_SALES_MANAGER |
Yasmin |
ROLE_SALES_REP |
For details about creating users, refer to the JasperReports Server Administrator Guide.
Profile Attributes
A profile attribute is a name-value pair defined at the user level that corresponds to some data in a Domain. CZS wants to be able to describe their users in terms of product lines that they sell and the cities where they sell them. Thus, each CZS user is assigned two profile attributes in addition to the users’ roles:
User |
Profile Attributes |
|
Cities |
Product/Department |
|
Rita |
San Francisco, Los Angeles, Sacramento |
Television, Wireless Devices |
Pete |
San Francisco |
Television |
Yasmin |
San Francisco |
Wireless Devices |
Alexi |
Osaka, Sakai |
Wireless Devices |
The security file shown in Domain Security File refers to two of these profile attributes:
• | The Cities profile attribute corresponds to the City field in the Geography item group in the Sales Domain. |
• | The ProductDepartment attribute corresponds to the Department field in the Product item group in the Sales Domain. |
Each user’s attributes determine the data returned to him by the Domain, based on an access grant definition that refers to profile attributes. For example, Rita’s attribute value for Cities is San Francisco,Los Angeles,Sacramento while Pete’s is San Francisco. Thus, Pete sees less data than Rita does.
As of JasperReports Server 5.0, user profile attributes can be created via the JasperReports Server user interface. Refer to the JasperReports Server Administrator Guide for details. For information on configuring profile attributes in earlier versions of JasperReports Server, see the JasperReports Library Ultimate Guide corresponding to your version.
The following figure shows the configuration of Rita’s user account. Notice Rita’s profile attributes listed below her roles:
|
CZS User Rita’s Configuration |