com.netgrif.application.engine.startup.SystemUserRunner.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of application-engine Show documentation
Show all versions of application-engine Show documentation
System provides workflow management functions including user, role and data management.
package com.netgrif.application.engine.startup
import com.netgrif.application.engine.auth.domain.IUser
import com.netgrif.application.engine.auth.domain.LoggedUser
import com.netgrif.application.engine.auth.service.interfaces.IUserService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.stereotype.Component
@Component
@ConditionalOnProperty(value = "admin.create-system-user", matchIfMissing = true)
class SystemUserRunner extends AbstractOrderedCommandLineRunner {
public static final String SYSTEM_USER_EMAIL = "[email protected]"
public static final String SYSTEM_USER_NAME = "application"
public static final String SYSTEM_USER_SURNAME = "engine"
@Autowired
private IUserService service
private IUser systemUser
IUser createSystemUser() {
return service.createSystemUser()
}
LoggedUser getLoggedSystem() {
return this.systemUser.transformToLoggedUser()
}
@Override
void run(String... strings) throws Exception {
this.systemUser = createSystemUser()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy