use of com.tremolosecurity.provisioning.core.UserStoreProviderWithAddGroup in project OpenUnison by TremoloSecurity.
the class DoesGroupExist method doTask.
@Override
public boolean doTask(User user, Map<String, Object> request) throws ProvisioningException {
String localGroupName = task.renderTemplate(groupName, request);
UserStoreProviderWithAddGroup provTarget = (UserStoreProviderWithAddGroup) GlobalEntries.getGlobalEntries().getConfigManager().getProvisioningEngine().getTarget(this.target).getProvider();
if (provTarget.isGroupExists(localGroupName, user, request)) {
user.getAttribs().put(this.attributeName, new Attribute(this.attributeName, "true"));
} else {
user.getAttribs().put(this.attributeName, new Attribute(this.attributeName, "false"));
}
return true;
}
use of com.tremolosecurity.provisioning.core.UserStoreProviderWithAddGroup in project OpenUnison by TremoloSecurity.
the class AddGroupToStore method doTask.
@Override
public boolean doTask(User user, Map<String, Object> request) throws ProvisioningException {
UserStoreProvider target = task.getConfigManager().getProvisioningEngine().getTarget(this.target).getProvider();
if (target instanceof UserStoreProviderWithAddGroup) {
request.put("WORKFLOW", this.task.getWorkflow());
Map<String, String> localAttrs = new HashMap<String, String>();
localAttrs.putAll(attributes);
for (String key : localAttrs.keySet()) {
localAttrs.put(key, task.renderTemplate(localAttrs.get(key), request));
}
for (String name : names) {
if (!((UserStoreProviderWithAddGroup) target).isGroupExists(task.renderTemplate(name, request), user, request)) {
((UserStoreProviderWithAddGroup) target).addGroup(task.renderTemplate(name, request), localAttrs, user, request);
}
}
} else {
logger.warn("Target '" + this.target + "' can not add groups");
}
return true;
}
use of com.tremolosecurity.provisioning.core.UserStoreProviderWithAddGroup in project OpenUnison by TremoloSecurity.
the class DoesGroupExist method doTask.
@Override
public boolean doTask(User user, Map<String, Object> request) throws ProvisioningException {
String localGroupName = task.renderTemplate(groupName, request);
UserStoreProviderWithAddGroup provTarget = (UserStoreProviderWithAddGroup) GlobalEntries.getGlobalEntries().getConfigManager().getProvisioningEngine().getTarget(this.target).getProvider();
if (provTarget.isGroupExists(localGroupName, user, request)) {
user.getAttribs().put(this.attributeName, new Attribute(this.attributeName, "true"));
} else {
user.getAttribs().put(this.attributeName, new Attribute(this.attributeName, "false"));
}
return true;
}
Aggregations