Search in sources :

Example 6 with Approvers

use of com.tremolosecurity.provisioning.objects.Approvers in project OpenUnison by TremoloSecurity.

the class AzUtils method loadCustomApprovers.

public static boolean loadCustomApprovers(Approvals approval, String emailTemplate, ConfigManager cfg, Session session, int userID, String constraint, boolean sendNotification, CustomAuthorization caz, String[] customParams) throws ProvisioningException {
    boolean found = false;
    try {
        caz.loadConfigManager(cfg);
        List<String> approvalDNs = caz.listPossibleApprovers(customParams);
        for (String approverDN : approvalDNs) {
            Approvers approver = getApproverByDN(approval, emailTemplate, cfg, session, approverDN, sendNotification);
            if (approver == null) {
                continue;
            }
            AllowedApprovers allowed = new AllowedApprovers();
            allowed.setApprovals(approval);
            allowed.setApprovers(approver);
            session.save(allowed);
            found = true;
        }
    } catch (Exception e) {
        throw new ProvisioningException("Could not load approvers", e);
    }
    return found;
}
Also used : AllowedApprovers(com.tremolosecurity.provisioning.objects.AllowedApprovers) Approvers(com.tremolosecurity.provisioning.objects.Approvers) AllowedApprovers(com.tremolosecurity.provisioning.objects.AllowedApprovers) ProvisioningException(com.tremolosecurity.provisioning.core.ProvisioningException) LDAPException(com.novell.ldap.LDAPException) SQLException(java.sql.SQLException) ProvisioningException(com.tremolosecurity.provisioning.core.ProvisioningException) LDAPReferralException(com.novell.ldap.LDAPReferralException)

Aggregations

AllowedApprovers (com.tremolosecurity.provisioning.objects.AllowedApprovers)6 Approvers (com.tremolosecurity.provisioning.objects.Approvers)6 LDAPException (com.novell.ldap.LDAPException)5 SQLException (java.sql.SQLException)5 LDAPAttribute (com.novell.ldap.LDAPAttribute)4 LDAPEntry (com.novell.ldap.LDAPEntry)4 LDAPReferralException (com.novell.ldap.LDAPReferralException)4 LDAPSearchResults (com.novell.ldap.LDAPSearchResults)4 ProvisioningException (com.tremolosecurity.provisioning.core.ProvisioningException)4 ArrayList (java.util.ArrayList)3 ApproverAttributes (com.tremolosecurity.provisioning.objects.ApproverAttributes)2 Query (org.hibernate.Query)2 Gson (com.google.gson.Gson)1 LDAPAttributeSet (com.novell.ldap.LDAPAttributeSet)1 Token (com.tremolosecurity.json.Token)1 User (com.tremolosecurity.provisioning.core.User)1 Approvals (com.tremolosecurity.provisioning.objects.Approvals)1 Approval (com.tremolosecurity.provisioning.tasks.Approval)1 AuthInfo (com.tremolosecurity.proxy.auth.AuthInfo)1 AzSys (com.tremolosecurity.proxy.auth.AzSys)1