Roles, Users, and Attributes

Roles, Users, and Attributes

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.

User Attributes

A user 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. So each user is assigned two attributes in addition to a role:

UserAttributes of All CZS Users

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 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 user attributes. For example, Rita’s attribute value for Cities is San Francisco,Los Angeles,Sacramento. So she sees data for all those cities.

For information on configuring user attributes in earlier versions of JasperReports Server, see the JasperReports Library Ultimate Guide for your version.

The following figure shows the configuration of Rita’s user account. Notice Rita’s attributes listed below her roles:

CZS User Rita’s Configuration

Feedback
randomness