Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yaru
fgqyxxlr
Commits
0f7952b9
Commit
0f7952b9
authored
Sep 12, 2019
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加isUser,便于校验用户是否已登录
parent
fcc889ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java
+15
-4
No files found.
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java
View file @
0f7952b9
...
...
@@ -50,7 +50,7 @@ public class PermissionService
}
/**
* 验证用户是否具有以下任意一个
角色
,无权限返回hidden用于隐藏(如需返回Boolean使用hasAnyPermissions)
* 验证用户是否具有以下任意一个
权限
,无权限返回hidden用于隐藏(如需返回Boolean使用hasAnyPermissions)
*
* @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表
* @return 用户是否具有以下任意一个权限
...
...
@@ -61,7 +61,7 @@ public class PermissionService
}
/**
* 验证用户
用户
是否具备某角色,无权限返回hidden用于隐藏(如需返回Boolean使用isRole)
* 验证用户是否具备某角色,无权限返回hidden用于隐藏(如需返回Boolean使用isRole)
*
* @param role 角色字符串
* @return 用户是否具备某角色
...
...
@@ -72,7 +72,7 @@ public class PermissionService
}
/**
* 验证用户
用户
是否不具备某角色,与hasRole逻辑相反。无权限返回hidden用于隐藏(如需返回Boolean使用isLacksRole)
* 验证用户是否不具备某角色,与hasRole逻辑相反。无权限返回hidden用于隐藏(如需返回Boolean使用isLacksRole)
*
* @param role 角色字符串
* @return 用户是否不具备某角色
...
...
@@ -83,7 +83,7 @@ public class PermissionService
}
/**
* 验证用户
用户
是否具有以下任意一个角色,无权限返回hidden用于隐藏(如需返回Boolean使用isAnyRoles)
* 验证用户是否具有以下任意一个角色,无权限返回hidden用于隐藏(如需返回Boolean使用isAnyRoles)
*
* @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表
* @return 用户是否具有以下任意一个角色
...
...
@@ -94,6 +94,17 @@ public class PermissionService
}
/**
* 验证用户是否认证通过或已记住的用户。
*
* @return 用户是否认证通过或已记住的用户
*/
public
boolean
isUser
()
{
Subject
subject
=
SecurityUtils
.
getSubject
();
return
subject
!=
null
&&
subject
.
getPrincipal
()
!=
null
;
}
/**
* 判断用户是否拥有某个权限
*
* @param permission 权限字符串
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment