diff --git a/.forge/BAIS-RECOVERY-MIG-001-attempt-1.md b/.forge/BAIS-RECOVERY-MIG-001-attempt-1.md new file mode 100644 index 0000000..786b847 --- /dev/null +++ b/.forge/BAIS-RECOVERY-MIG-001-attempt-1.md @@ -0,0 +1,3 @@ +# BAIS-RECOVERY-MIG-001-attempt-1 + +Forge 이슈 작업 브랜치 `forge/BAIS-RECOVERY-MIG-001-attempt-1`. diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..3c4eaa1 --- /dev/null +++ b/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + com.example + bais-authorization-service + 1.0-SNAPSHOT + jar + + + org.springframework.boot + spring-boot-starter-parent + 3.1.0 + + + + + 17 + + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M5 + + + + \ No newline at end of file diff --git a/src/main/java/com/example/authorization/AuthorizationService.java b/src/main/java/com/example/authorization/AuthorizationService.java new file mode 100644 index 0000000..17ea076 --- /dev/null +++ b/src/main/java/com/example/authorization/AuthorizationService.java @@ -0,0 +1,11 @@ +package com.example.authorization; + +import org.springframework.stereotype.Service; + +@Service +public class AuthorizationService { + public boolean hasAccess(String userRole, String resource) { + // Simple access control logic + return "ADMIN".equals(userRole); + } +} \ No newline at end of file diff --git a/src/test/java/com/example/authorization/AuthorizationServiceTest.java b/src/test/java/com/example/authorization/AuthorizationServiceTest.java new file mode 100644 index 0000000..e2bdde2 --- /dev/null +++ b/src/test/java/com/example/authorization/AuthorizationServiceTest.java @@ -0,0 +1,14 @@ +package com.example.authorization; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + +class AuthorizationServiceTest { + + @Test + void testHasAccess() { + AuthorizationService service = new AuthorizationService(); + assertTrue(service.hasAccess("ADMIN", "someResource")); + assertFalse(service.hasAccess("USER", "someResource")); + } +} \ No newline at end of file