Example: Allowing only buyers to redeem coupons

By default, all users are permitted to redeem coupons. In some cases, you may want to limit coupon redemption to users with the Buyer (Buy-side) role in HCL Commerce.

This topic is deprecated and is provided for backward compatibility only.

In this example, you will change a resource-level policy, as well as its associated role-based policy. To limit coupon redemption to users with the Buyer (Buy-side) role, you need to do the following:

  • Determine the resource-level policy that specifies who can redeem a coupon.
  • Change the policy's access group from all users, to those with the Buyer (Buy-side) role.
  • Identify the command for redeeming coupons.
  • Determine the role-based policy for Buyer (buy-side). This policy defines the commands that users with the Buyer (buy-side) role can execute. You must update this policy's resource group to permit buyers to execute the command for redeeming coupons.
  • Update this role-based policy's resource group to include the commands for redeeming coupons.

Identify the resource-level policy and its action group

  1. Identify the resource-level policy to be changed. The policy is:
    
    AllUsersExecuteCouponRedemptionCommandsOnCouponWalletResource
    
  2. From the Organization Administration Console, click Access Management > Policies.
  3. For View, select Root Organization to display policies it owns.
  4. From the list of policies, select the following:
    AllUsersExecuteCouponRedemptionCommandsOnCoupon
    WalletResource
    
  5. Note the name of the policy's action group-- CouponRedemption. This is the action group you must view to find the name of the commands for redeeming coupons.

Change the access group

  1. Click Change to display the Change Policy page.
  2. For User Group, click Find and select Buyers (buy-side).
  3. Click OK.
  4. Update the policy's name, display name, and description to reflect the change of access group.
  5. Click OK.

Identify the commands for redeeming coupons

  1. Click Access Management > Action Groups.
  2. From the list of action groups, select CouponRedemption.
  3. Click Change to display the Change Action Group page. Note the name of the commands for creating bids:
    
       com.ibm.commerce.couponredemption.commands.CouponDSSCmd
      com.ibm.commerce.couponredemption.commands.UseCouponIdCmd
    
    You must add these commands to the resource group that contains the list of commands a buyer can execute.

Identify the role-based policy for buyers (buy-side)

  1. Find the role-based policy for buyers (buy-side). The policy is:

    Buyers(buy-side)ExecuteBuyers(buy-side)CommandsResourceGroup

  2. Click Access Management > Policies.
  3. For View, select Root Organization to display the policies it owns.
  4. Locate the policy in the list.
  5. Note the name of the resource group: Buyers(buy-side)CommandsResourceGroup. This is the name of the resource group you need to update.

Update the resource group in the role-based policy to include the command for creating bids

  1. Click Access Management > Resource Groups.
  2. Select Buyers(buy-side)CommandsResourceGroup.
  3. Click Change to display the Change Resource Group page.
  4. Click Next to display the Details page.
  5. From the Available Resources list, select com.ibm.commerce.couponredemption.commands.CouponDSSCmd com.ibm.commerce.couponredemption.commands.UseCouponIdCmd. These are the commands for redeeming coupons.
  6. Click Add to add the commands to the resource group.
  7. Click Finish.

Update the access control policy registry with your changes

  1. Open the Administration Console.
  2. Click Configuration > Registry.
  3. From the list of registries, select Access Control Policies.
  4. Click Update.