mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-14 03:25:02 +00:00
formatting
This commit is contained in:
parent
7c0b87efe8
commit
7d062c0824
@ -147,6 +147,11 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
dependsOn "spotlessApply"
|
||||||
|
}
|
||||||
|
|
||||||
licenseReport {
|
licenseReport {
|
||||||
renderers = [new JsonReportRenderer()]
|
renderers = [new JsonReportRenderer()]
|
||||||
allowedLicensesFile = new File("$projectDir/allowed-licenses.json")
|
allowedLicensesFile = new File("$projectDir/allowed-licenses.json")
|
||||||
|
@ -51,7 +51,6 @@ public class InitialSecuritySetup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void assignUsersToDefaultTeamIfMissing() {
|
private void assignUsersToDefaultTeamIfMissing() {
|
||||||
Team defaultTeam = teamService.getOrCreateDefaultTeam();
|
Team defaultTeam = teamService.getOrCreateDefaultTeam();
|
||||||
List<User> usersWithoutTeam = userService.getUsersWithoutTeam();
|
List<User> usersWithoutTeam = userService.getUsersWithoutTeam();
|
||||||
@ -61,7 +60,8 @@ public class InitialSecuritySetup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
userService.saveAll(usersWithoutTeam); // batch save
|
userService.saveAll(usersWithoutTeam); // batch save
|
||||||
log.info("Assigned {} user(s) without a team to the default team.", usersWithoutTeam.size());
|
log.info(
|
||||||
|
"Assigned {} user(s) without a team to the default team.", usersWithoutTeam.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeAdminUser() throws SQLException, UnsupportedProviderException {
|
private void initializeAdminUser() throws SQLException, UnsupportedProviderException {
|
||||||
|
@ -5,9 +5,7 @@ import java.lang.annotation.Retention;
|
|||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
/**
|
/** Annotation to mark endpoints that require a Pro or higher license. */
|
||||||
* Annotation to mark endpoints that require a Pro or higher license.
|
|
||||||
*/
|
|
||||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface PremiumEndpoint {}
|
public @interface PremiumEndpoint {}
|
@ -18,7 +18,8 @@ public class PremiumEndpointAspect {
|
|||||||
this.runningProOrHigher = runningProOrHigher;
|
this.runningProOrHigher = runningProOrHigher;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Around("@annotation(stirling.software.proprietary.security.config.PremiumEndpoint) || @within(stirling.software.proprietary.security.config.PremiumEndpoint)")
|
@Around(
|
||||||
|
"@annotation(stirling.software.proprietary.security.config.PremiumEndpoint) || @within(stirling.software.proprietary.security.config.PremiumEndpoint)")
|
||||||
public Object checkPremiumAccess(ProceedingJoinPoint joinPoint) throws Throwable {
|
public Object checkPremiumAccess(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||||
if (!runningProOrHigher) {
|
if (!runningProOrHigher) {
|
||||||
throw new ResponseStatusException(
|
throw new ResponseStatusException(
|
||||||
|
@ -21,7 +21,11 @@ import stirling.software.common.model.exception.UnsupportedProviderException;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Getter
|
@Getter
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableJpaRepositories(basePackages = {"stirling.software.proprietary.security.database.repository", "stirling.software.proprietary.security.repository"})
|
@EnableJpaRepositories(
|
||||||
|
basePackages = {
|
||||||
|
"stirling.software.proprietary.security.database.repository",
|
||||||
|
"stirling.software.proprietary.security.repository"
|
||||||
|
})
|
||||||
@EntityScan({"stirling.software.proprietary.security.model", "stirling.software.proprietary.model"})
|
@EntityScan({"stirling.software.proprietary.security.model", "stirling.software.proprietary.model"})
|
||||||
public class DatabaseConfig {
|
public class DatabaseConfig {
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
import stirling.software.proprietary.model.Team;
|
import stirling.software.proprietary.model.Team;
|
||||||
import stirling.software.proprietary.security.config.PremiumEndpoint;
|
|
||||||
import stirling.software.proprietary.security.database.repository.SessionRepository;
|
import stirling.software.proprietary.security.database.repository.SessionRepository;
|
||||||
import stirling.software.proprietary.security.database.repository.UserRepository;
|
import stirling.software.proprietary.security.database.repository.UserRepository;
|
||||||
import stirling.software.proprietary.security.model.User;
|
import stirling.software.proprietary.security.model.User;
|
||||||
@ -25,7 +24,6 @@ import stirling.software.proprietary.security.repository.TeamRepository;
|
|||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/teams")
|
@RequestMapping("/teams")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|
||||||
public class TeamWebController {
|
public class TeamWebController {
|
||||||
|
|
||||||
private final TeamRepository teamRepository;
|
private final TeamRepository teamRepository;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user