提交 | 用户 | 时间
|
1ac2bc
|
1 |
/** |
懒 |
2 |
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng) |
|
3 |
* <p> |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* <p> |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* <p> |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
package cn.stylefeng.guns.base.auth.annotion; |
|
17 |
|
|
18 |
import java.lang.annotation.*; |
|
19 |
|
|
20 |
/** |
|
21 |
* 权限注解 用于检查权限 规定访问权限 |
|
22 |
* |
|
23 |
* @example @Permission({role1,role2}) |
|
24 |
* @example @Permission |
|
25 |
*/ |
|
26 |
@Inherited |
|
27 |
@Retention(RetentionPolicy.RUNTIME) |
|
28 |
@Target({ElementType.METHOD}) |
|
29 |
public @interface Permission { |
|
30 |
|
|
31 |
/** |
|
32 |
* <p>角色英文名称</p> |
|
33 |
* <p>使用注解时加上这个值表示限制只有某个角色的才可以访问对应的资源</p> |
|
34 |
* <p>常用在某些资源限制只有超级管理员角色才可访问</p> |
|
35 |
*/ |
|
36 |
String[] value() default {}; |
|
37 |
} |