All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.frachtwerk.essencium.backend.configuration.properties.InitProperties Maven / Gradle / Ivy

Go to download

Essencium Backend is a software library built on top of Spring Boot that allows developers to quickly get started on new software projects. Essencium provides, for example, a fully implemented role-rights concept as well as various field-tested solutions for access management and authentication.

The newest version!
package de.frachtwerk.essencium.backend.configuration.properties;

import java.util.HashSet;
import java.util.Set;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Data
@EqualsAndHashCode(callSuper = false)
@Configuration
@ConfigurationProperties(prefix = "essencium.init")
public class InitProperties {
  private Set users = new HashSet<>();
  private Set roles = new HashSet<>();

  public Set getRoles() {
    if (roles.stream().noneMatch(role -> role.getName().equals("ADMIN"))) {
      roles.add(new RoleProperties());
    }
    return roles;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy