org.molgenis.data.security.auth.GroupFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of molgenis-data-security Show documentation
Show all versions of molgenis-data-security Show documentation
Security data model and data layer security.
package org.molgenis.data.security.auth;
import org.molgenis.data.AbstractSystemEntityFactory;
import org.molgenis.data.populate.EntityPopulator;
import org.molgenis.security.core.model.GroupValue;
import org.springframework.stereotype.Component;
@Component
public class GroupFactory extends AbstractSystemEntityFactory {
GroupFactory(GroupMetadata groupMetadata, EntityPopulator entityPopulator) {
super(Group.class, groupMetadata, entityPopulator);
}
public Group create(GroupValue groupValue) {
Group group = create();
group.setName(groupValue.getName());
group.setLabel(groupValue.getLabel());
group.setDescription(groupValue.getDescription());
group.setPublic(groupValue.isPublic());
return group;
}
}