要根据安全角色来作出此类决定。
EJB部署计划中的安全角色映射。
按照如下步骤改变安全角色。
创建名为BPEUser的安全角色。
添加安全角色administrator。
然而,以粗体显示的安全角色是这里讨论的重点。
设置安全和绑定安全角色。
您将看到名为agents的J2EE安全角色。
role-name元素指定安全角色的名称。
The role-name element specifies the name of the security role.
在部署过程中用户和组可以与每个安全角色联结。
Users or groups can be associated with each security role during deployment. In the sample application, two security roles have been defined: manager and employee.
图3显示了为示例Web应用程序创建的安全角色。
Figure 3 shows the security roles created for our sample Web application.
对于每个安全角色,必须声明相应的主体类及其名称。
For each security role, a corresponding principal class and its name must be declared.
我们对每个要映射的安全角色使用一个role元素。
使用WebSphere绑定扩展属性来映射安全角色。
Mapping security roles using the WebSphere binding extension properties.
在此部分,我们将了解如何定义安全角色和配置方法权限。
In this section we see how to define security roles and configure method permissions.
单击add添加一个名为everyone的安全角色。
图22显示了正在链接到适当安全角色的安全性角色引用。
Figure 22 shows the security role Reference being linked to the appropriate security role.
按钮来收集在所有Web及EJB模块中定义的安全角色。
Button to collect all the security roles defined in all the Web and EJB modules.
单击Gather显示前面定义的在ear层的安全角色。
Click Gather to display the security roles we defined previously at the EAR level.
可将J2EE安全角色和约束添加到应用程序的部署描述符。
J2EE security roles and constraints are added to the deployment descriptor of the application.
首先,在EJB部署描述符中声明安全角色,如清单8所示。
First, security roles are declared in the EJB deployment descriptor similar to the example shown in Listing 8.
管理和应用程序安全性需要启用,以实施安全角色。
Administrative and application security needs to be enabled in order for security roles to be enforced.
两个安全角色使用security-role元素定义。
The two security roles are defined using security-role elements.
对于我们的示例,安全角色已经在导入的项目交换文件中进行了定义。
For our example, the security roles are already defined in the project interchange file you imported.
此后,必须在部署期间分配一个是指定的安全角色的成员的实际用户。
After that, during the deployment, you have to assign a real user that is a member of the specified security role.
security - roleXML元素包含单个安全角色的声明。
The security-role XML element contains a declaration of a single security role.
使用WebSphere绑定扩展属性将安全角色映射到身份验证状态。
Use the WebSphere binding extension properties to map the security roles to an authentication status.
isUserInRole:此方法判定远程用户是否具有特定的安全角色。
IsUserInRole: This method determines whether a remote user is in a specific security role.
安全角色的名称在role元素的 role-name属性中指定。
The name of the security role is specified in the role-name attribute of the role element.
在这一步里,我们建立了前面定义的安全角色和他们的身份验证状态之间的关系。
In this step, we establish the relationship between the security roles that we defined previously and their authentication status.
应用推荐