CoreAttributeConstants.EVENT_ATTR_POLICY_NAME,
pol.getResourceName()).addAttribute(CoreAttributeConstants.EVENT_ATTR_PRINCIPAL_ID, user.getPrincipalName()));
}
for (Iterator i = ((PropertyList) seq.getAttribute(PolicyPrincipalSelectionForm.ATTR_SELECTED_ROLES, null))
.iterator(); i.hasNext();) {
Role role = udb.getRole((String) i.next());
PolicyDatabaseFactory.getInstance().grantPolicyToPrincipal(pol,
role);
CoreServlet.getServlet().fireCoreEvent(new CoreEvent(this, CoreEventConstants.GRANT_POLICY_TO_PRINCIPAL, pol, getSessionInfo(request),
CoreEvent.STATE_SUCCESSFUL).addAttribute(CoreAttributeConstants.EVENT_ATTR_PRINCIPAL_TYPE, "group").addAttribute(
CoreAttributeConstants.EVENT_ATTR_POLICY_NAME,
pol.getResourceName()).addAttribute(CoreAttributeConstants.EVENT_ATTR_PRINCIPAL_ID, role.getPrincipalName()));
}
actionStatus.add(new WizardActionStatus(WizardActionStatus.COMPLETED_OK,
"policyWizard.policyFinish.status.grantedToPrincipals"));
} catch (Exception e) {
log.error("Failed to grant principals to policy.", e);