mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
change role to enum
This commit is contained in:
25
src/main/java/com/commafeed/frontend/SecurityCheck.java
Normal file
25
src/main/java/com/commafeed/frontend/SecurityCheck.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.commafeed.frontend;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import javax.enterprise.util.Nonbinding;
|
||||
import javax.interceptor.InterceptorBinding;
|
||||
|
||||
import com.commafeed.backend.model.UserRole.Role;
|
||||
|
||||
@Inherited
|
||||
@InterceptorBinding
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface SecurityCheck {
|
||||
|
||||
/**
|
||||
* Roles needed.
|
||||
*/
|
||||
@Nonbinding
|
||||
Role value() default Role.USER;
|
||||
}
|
||||
Reference in New Issue
Block a user