Created
June 30, 2019 21:09
-
-
Save MrMjauh/1eeaed6bef474d9dc734940fb3dc3e8d to your computer and use it in GitHub Desktop.
MetaAnnotations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Target(ElementType.METHOD) | |
@Retention(RetentionPolicy.RUNTIME) | |
@PreAuthorize("hasAuthority('" + SecurityResource.Role.ADMIN + "')") | |
public @interface AccessAdmin { | |
} | |
@Target(ElementType.METHOD) | |
@Retention(RetentionPolicy.RUNTIME) | |
@PreAuthorize("hasAnyAuthority('" + SecurityResource.Role.ADMIN + "','" + SecurityResource.Role.USER + "')") | |
public @interface AccessAuthenticated { | |
} | |
@Target(ElementType.METHOD) | |
@Retention(RetentionPolicy.RUNTIME) | |
@PreAuthorize("hasAuthority('" + SecurityResource.Role.USER + "')") | |
public @interface AccessUser { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment