From c836384126cde06645521fa0e638efe99885ce6b Mon Sep 17 00:00:00 2001 From: YoungJun Park Date: Sun, 17 Oct 2021 13:27:34 +0900 Subject: [PATCH] =?UTF-8?q?[#4]=20Auth=20Custom=20Annotation=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lazy/common/annotation/AuthUser.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 common/src/main/java/com/teamnexters/lazy/common/annotation/AuthUser.java diff --git a/common/src/main/java/com/teamnexters/lazy/common/annotation/AuthUser.java b/common/src/main/java/com/teamnexters/lazy/common/annotation/AuthUser.java new file mode 100644 index 0000000..5970131 --- /dev/null +++ b/common/src/main/java/com/teamnexters/lazy/common/annotation/AuthUser.java @@ -0,0 +1,15 @@ +package com.teamnexters.lazy.common.annotation; + +import org.springframework.security.core.annotation.AuthenticationPrincipal; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") +public @interface AuthUser { + +} \ No newline at end of file