IBM Verify

IBM Verify

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

How to update the entitlement end date in IGI

By Nishant Singhai posted Mon January 06, 2020 01:36 PM

  

Authors: Nishant Singhai and Ranvijay Singh

In IGI there are multiple options to update the entitlement end date.

  1. From the Admin console
  2. Using the API

Approach 1, steps are as below:

  • Select the user and entitlements tab from ACG console

 

  • From actions click add

 

  • On the popup filter the specific entitlement

 

 

  • Now select and click ok and provide a new end date and click ok.

 

  • After submission the end date of user entitlement is modified

 

 

Approach 2:

Using the API UserAction.addRoles().

For example, if we want to modify the user entitlement end date based on some modification from the access request, we can attach a post action rule below

Code:

when

    request : SwimRequestBean(  )

then

Calendar cal = Calendar.getInstance();

cal.setTime(cal.getTime());

cal.add(Calendar.DATE,-1);

Date  newDate = cal.getTime();

String beneficiary = request.getBeneficiary_userid();

UserBean benificiaryBean = UtilAction.findUserByCode(sql,beneficiary);

BeanList<EntitlementBean> roleList = UserAction.findJobRoles(sql,benificiaryBean);

BeanList<EntitlementBean> updatedRoleList = new BeanList<EntitlementBean>();

 

 

if ( roleList != null && roleList.size()>0)

{

    Iterator<EntitlementBean> its = roleList.iterator();

    while ( its.hasNext() )

    {

    EntitlementBean entBean = its.next();

    if ( entBean.getType() == EntitlementType.PERMISSION.getCode())

    {

    logger.info("Setting the end date for role " +entBean.getName());

    updatedRoleList.add(entBean);

    }

    }

UserAction.addRoles(sql,benificiaryBean,null,updatedRoleList,null,newDate,true);

}

0 comments
5 views

Permalink