Specify Access to Channel Operations Restricting Access to All Channel Operations

12-16 Developing Web Applications, Servlets, and JSPs for Oracle WebLogic Server In this example, the operation publish for the stock and managementpublisher channels is available only to users with the WebLogic Server role publisher.

12.5.1.1 Specify Access to Channel Operations

Four types of actions operations are allowed on channels: ■ create ■ delete ■ subscribe ■ publish By default with no channel constraints defined, subscribe operations are open for all users on all channels. Similarly, create, delete, and publish operations are restricted for all users on all channels by default. Create, delete, and publish operations are allowed only if explicitly configured in channel constraints. You use a combination of wlps:channel-operation and wlps:auth-constraint to specify access to a channel operation for a given role. For example, in Example 12–2 , the publish operation is permitted for authenticated subjects with the publisher role, and denied to all other roles. Example 12–2 Publisher Role Constraint wlps:channel-constraint wlps:channel-resource-collection wlps:channel-resource-namepublishwlps:channel-resource-name wlps:descriptionpublish channel constraintwlps:description wlps:channel-patternstock wlps:channel-pattern wlps:channel-patternmanagementpublisherwlps:channel-pattern wlps:channel-operationpublishwlps:channel-operation wlps:channel-resource-collection wlps:auth-constraint wlps:descriptionpublisherwlps:description wlps:role-namepublisherwlps:role-name wlps:auth-constraint wlps:channel-constraint

12.5.1.2 Restricting Access to All Channel Operations

The presence of an empty authorization constraint wlps:auth-constraint wlps:auth-constraint means that all access is prohibited for the specified channel operations, or all channel operations if wlps:channel-operation is not specified. Therefore, to restrict all channel operations for the channel for all users, set up your weblogic-pub-sub.xml configuration file with an empty wlps:auth-constraint element, as follows: wlps:channel-constraint wlps:channel-resource-collection wlps:descriptionRestrict All Acessswlps:description Using the HTTP Publish-Subscribe Server 12-17 wlps:channel-patternwlps:channel-pattern wlps:channel-resource-collection wlps:auth-constraint wlps:auth-constraint wlps:channel-constraint

12.5.1.3 Opening Access to All Channel Operations