|
@@ -53,6 +53,7 @@ type PermUrlInstruction struct {
|
|
|
Description string
|
|
Description string
|
|
|
NeedCheckExpire bool
|
|
NeedCheckExpire bool
|
|
|
SensitiveWordScene int
|
|
SensitiveWordScene int
|
|
|
|
|
+ Privilege bool
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (cmd *PermUrlInstruction) check() error {
|
|
func (cmd *PermUrlInstruction) check() error {
|
|
@@ -95,6 +96,7 @@ const (
|
|
|
permTagPartDescription = "description"
|
|
permTagPartDescription = "description"
|
|
|
permTagPartNeedCheckExpire = "needCheckExpire"
|
|
permTagPartNeedCheckExpire = "needCheckExpire"
|
|
|
permTagPartSensitiveWordScene = "sensitiveWordScene"
|
|
permTagPartSensitiveWordScene = "sensitiveWordScene"
|
|
|
|
|
+ permTagPartPrivilege = "privilege"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
func parseRelativePathPerm(basePath string, relativePathPattern string, method string) (string, *PermissionItem, error) {
|
|
func parseRelativePathPerm(basePath string, relativePathPattern string, method string) (string, *PermissionItem, error) {
|
|
@@ -129,6 +131,7 @@ func parseRelativePathPerm(basePath string, relativePathPattern string, method s
|
|
|
Action: method,
|
|
Action: method,
|
|
|
NeedCheckExpire: false,
|
|
NeedCheckExpire: false,
|
|
|
SensitiveWordScene: 0,
|
|
SensitiveWordScene: 0,
|
|
|
|
|
+ Privilege: false,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for _, tagPart := range tagParts {
|
|
for _, tagPart := range tagParts {
|
|
@@ -158,6 +161,8 @@ func parseRelativePathPerm(basePath string, relativePathPattern string, method s
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
permissionItem.SensitiveWordScene = scene
|
|
permissionItem.SensitiveWordScene = scene
|
|
|
|
|
+ case permTagPartPrivilege:
|
|
|
|
|
+ permissionItem.Privilege = true
|
|
|
default:
|
|
default:
|
|
|
err := errors.New(permTagKey + "不支持的tag: " + tagPartKeyValue[0])
|
|
err := errors.New(permTagKey + "不支持的tag: " + tagPartKeyValue[0])
|
|
|
logger.GetInstance().Error(err)
|
|
logger.GetInstance().Error(err)
|