ru.foodtechlab.lib.auth.service.domain.roleAccess.config.RoleAccessConfig Maven / Gradle / Ivy
package ru.foodtechlab.lib.auth.service.domain.roleAccess.config;
import com.rcore.domain.security.model.AccessTokenData;
import com.rcore.domain.security.port.CredentialIdentityService;
import com.rcore.domain.security.port.TokenParser;
import com.rcore.event.driven.EventDispatcher;
import lombok.Getter;
import lombok.experimental.Accessors;
import ru.foodtechlab.lib.auth.service.domain.credential.port.CredentialRepository;
import ru.foodtechlab.lib.auth.service.domain.role.port.RoleRepository;
import ru.foodtechlab.lib.auth.service.domain.roleAccess.port.RoleAccessIdGenerator;
import ru.foodtechlab.lib.auth.service.domain.roleAccess.port.RoleAccessRepository;
import ru.foodtechlab.lib.auth.service.domain.roleAccess.usecase.*;
@Accessors(fluent = true)
@Getter
public class RoleAccessConfig {
private final CreateRoleAccessUseCase createRoleAccess;
private final FindRoleAccessesUseCase findRoleAccesses;
private final FindRoleAccessByIdUseCase findRoleAccessById;
private final UpdateRoleAccessUseCase updateRoleAccess;
private final DeleteRoleAccessUseCase deleteRoleAccess;
private final CheckAccessByAccessTokenUseCase checkAccess;
private final FindAccessesByRoleIdsUseCase findAccessesByRoleIds;
private final GenerateGodModAccessUseCase generateGodModAccess;
public RoleAccessConfig(
RoleAccessRepository roleAccessRepository,
RoleAccessIdGenerator> roleAccessIdGenerator,
RoleRepository roleRepository,
CredentialIdentityService credentialIdentityService,
EventDispatcher eventDispatcher) {
this.createRoleAccess = new CreateRoleAccessUseCase(roleAccessIdGenerator, roleAccessRepository);
this.findRoleAccesses = new FindRoleAccessesUseCase(roleAccessRepository);
this.findRoleAccessById = new FindRoleAccessByIdUseCase(roleAccessRepository);
this.updateRoleAccess = new UpdateRoleAccessUseCase(roleAccessRepository);
this.deleteRoleAccess = new DeleteRoleAccessUseCase(roleAccessRepository, eventDispatcher);
this.findAccessesByRoleIds = new FindAccessesByRoleIdsUseCase(roleAccessRepository);
this.checkAccess = new CheckAccessByAccessTokenUseCase(credentialIdentityService, roleRepository);
this.generateGodModAccess = new GenerateGodModAccessUseCase(roleAccessRepository, roleAccessIdGenerator);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy