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

Dynamic Rightlookup list in IGI

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

  
Authors: Nishant Singhai  and Ranvijay Singh 

In IGI sometimes we need to configure the right lookup. From the Admin console we can create such lookups. Sometimes we need to create long list and continuously update it.

Here are the steps that can help to create such rightlooks in IGI.

  1. From the Admin console Configure- Rules create advance rule:

  2. Rule code snippet for reference:

when

    eval( true )

then

logger.info("insertRightLookup -> Creating bean list");

 

RightsDAO dao = new RightsDAO(null);

 

dao.setConnection(true, "igacore", "lastModUser", "cod_oper", IdeasApplications.ACCESSGOVERNANCECORE.getName());

 

IRightsDirect rightsDirect = (IRightsDirect) DirectFactory.getDirectInterface(JndiNames.rightEJB);

 

Map<String, List<String>> map = new HashMap<>();

List<String> list = new ArrayList<String>();

list.add("A1");

list.add("A2");

map.put("P11", list);

 

list = new ArrayList<String>();

list.add("B1");

list.add("B2");

map.put("P22", list);

 

BeanList<RightsLookupBean> bl = new BeanList<>();

long myid = 1010;

for (Map.Entry<String, List<String>> entry : map.entrySet()) {

String content = entry.getKey();

List<String> values = entry.getValue();

for (String value : values) {

               RightsLookupBean rlb = new RightsLookupBean();

               rlb.setId(myid++);

               rlb.setContent(content);

               rlb.setValue(value);

               rlb.setInternalValue(value);

               rlb.setDescription("description");

               bl.add(rlb);

}

}

 

rightsDirect.insertRightsLookup(bl, dao);

dao.closeConnection();

 

Additional imports required in addition to standard imports:

import com.engiweb.profilemanager.common.bean.RightsLookupBean

import com.engiweb.pm.entity.BeanList

import com.ibm.igi.mapping.common.frontendbean.AttributePermValueBean

import com.engiweb.profilemanager.common.interfaces.IRightsDirect

import com.engiweb.profilemanager.backend.dao.rights.RightsDAO

 

  1. Once you setup the rule add it to rule flow:

 

  1. Create a new custom task from Task Planner and add the advanced rule.

Refer below screenshots:

 


In the scheduling tab you can choose to specify time when you would like to update the rightlookup list.

0 comments
12 views

Permalink