org.molgenis.data.security.auth.RoleFactory 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.RoleValue;
import org.springframework.stereotype.Component;
@Component
public class RoleFactory extends AbstractSystemEntityFactory {
RoleFactory(RoleMetadata roleMetadata, EntityPopulator entityPopulator) {
super(Role.class, roleMetadata, entityPopulator);
}
public Role create(RoleValue roleValue) {
Role result = create();
result.setName(roleValue.getName());
result.setLabel(roleValue.getLabel());
result.setDescription(roleValue.getDescription());
return result;
}
}