Project

General

Profile

Actions

Defect #460

closed

Automatic role for many Identities

Added by Marcel Poul almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Radek Tomiška
Category:
Roles
Target version:
Start date:
05/30/2017
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

Description

I was not able to assign automatic role to all users in IdM - hundreds.


Files

auto_role.png (26.1 KB) auto_role.png Filip Měšťánek, 05/31/2017 06:58 PM
role_remove.png (26.3 KB) role_remove.png Ondřej Kopr, 06/09/2017 09:16 AM
Actions #4

Updated by Radek Tomiška almost 7 years ago

  • Category set to Roles
  • Assignee changed from Radek Tomiška to Marcel Poul
  • Target version set to Citrine (7.3.0)
Actions #6

Updated by Marcel Poul almost 7 years ago

  • Assignee changed from Marcel Poul to Radek Tomiška
Actions #8

Updated by Radek Tomiška almost 7 years ago

  • Status changed from New to In Progress
  • Assignee changed from Radek Tomiška to Filip Měšťánek

The cause is in provisioning mapping:

...
Caused by: java.lang.SecurityException: Script wants to use unauthorized class: [java.lang.RuntimeException]
...
eu.bcvsolutions.idm.acc.service.impl.DefaultAccAccountManagementService.generateUID(DefaultAccAccountManagementService.java:301)
...

Actions #9

Updated by Filip Měšťánek almost 7 years ago

That could be, but in the tasks log there is nothing. No exception, no info. Even if I check application log, there is no exception. See the image.

When the cause was was the SecurityException, the tasks log showed a "Failed" state. Now it is "Executed".

Actions #10

Updated by Radek Tomiška almost 7 years ago

  • Assignee changed from Radek Tomiška to Filip Měšťánek

I think screenshot shows diferent taks.

Other things (show full exception in LRT etc) were added as new tickets ... so, did you fix exception from my comment?

Actions #12

Updated by Radek Tomiška almost 7 years ago

  • Assignee changed from Filip Měšťánek to Radek Tomiška
Actions #13

Updated by Radek Tomiška almost 7 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Radek Tomiška to Filip Měšťánek
  • % Done changed from 0 to 90

I've added try / catch mechanism to automatic role tasks:
- failed role code and failed identities (usernames) are shown i LRT detail. Whole exception can be found in role request agenda by identity's username
- failed role request can be executed again (e.g. after change mapping).
- remove automatic role task - added check for concurrently run task
- exception in role agenda will be improved in #480
- retry LRT mechanism will be improved in #466

Thank you for correcting the script. Could you deploy new version to test environment and make a test pls?

Actions #14

Updated by Ondřej Kopr almost 7 years ago

  • Assignee changed from Filip Měšťánek to Ondřej Kopr
Actions #15

Updated by Ondřej Kopr almost 7 years ago

  • File role_remove.png role_remove.png added
  • Status changed from Needs feedback to Resolved
  • Assignee changed from Ondřej Kopr to Radek Tomiška
  • % Done changed from 90 to 100
I did review:
  • create lots of users ~1500,
  • every user is in organization structure at random node,
  • add 6 roles to root of this organization structure with recursion down,
  • check long running task, counter and etc,
  • check random user if has roles,
  • + test on our project (same use case).

This use case works perfectly, thanks for update/fix this issue.

Test code:

        IdmTreeType type = treeTypeService.getByCode("test");

        IdmTreeNode parent = new IdmTreeNode();
        parent.setCode("parent");
        parent.setName("parent");
        parent.setTreeType(type);

        int nextParent = 0;

        List<UUID> treeNodeIds = new ArrayList<>();

        for (int index = 0; index < 50; index++) {
            IdmTreeNode treeNode = new IdmTreeNode();
            treeNode.setCode(String.valueOf(index));
            treeNode.setName(String.valueOf(index));
            treeNode.setTreeType(type);
            treeNode.setParent(parent);
            treeNode = treeNodeService.save(treeNode);
            treeNodeIds.add(treeNode.getId());
            //
            if (nextParent == 5) {
                nextParent = 0;
                parent = treeNode;
            } else {
                nextParent++;
            }
        }

        Random randomGenerator = new Random();

        for (int index = 0; index < 1500; index++) {
            String random = String.valueOf(System.currentTimeMillis());
            IdmIdentityDto user = new IdmIdentityDto();
            user.setUsername("xx_" + random);
            user.setFirstName("xx_" + random);
            user.setLastName("xx_" + random);
            user.setPassword(new GuardedString("a"));
            user = save(user);
            IdmIdentityContractDto contract = new IdmIdentityContractDto();
            //
            int indexId = randomGenerator.nextInt(treeNodeIds.size());
            contract.setWorkPosition(treeNodeIds.get(indexId));
            contract.setIdentity(user.getId());
            identityContractService.save(contract);
        }

Actions #16

Updated by Radek Tomiška almost 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF