mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
sonarqube质量修复
This commit is contained in:
+7
-1
@@ -157,6 +157,9 @@ public class SecurityFrameworkUtils {
|
||||
*/
|
||||
public static boolean isSuperAdmin() {
|
||||
LoginUser loginUser = getLoginUser();
|
||||
if (loginUser == null) {
|
||||
throw new ServiceException(GlobalErrorCodeConstants.UNAUTHORIZED);
|
||||
}
|
||||
return ObjectUtil.isNotNull(loginUser) && loginUser.getIsSupAdmin();
|
||||
}
|
||||
|
||||
@@ -167,6 +170,9 @@ public class SecurityFrameworkUtils {
|
||||
*/
|
||||
public static boolean isManageEndPoint() {
|
||||
LoginUser loginUser = getLoginUser();
|
||||
if (loginUser == null) {
|
||||
throw new ServiceException(GlobalErrorCodeConstants.UNAUTHORIZED);
|
||||
}
|
||||
return Objects.equals(loginUser.getUserType(), UserTypeEnum.ADMIN.getValue());
|
||||
}
|
||||
|
||||
@@ -186,7 +192,7 @@ public class SecurityFrameworkUtils {
|
||||
*/
|
||||
public static Long getProductId() {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
if (loginUser == null) {
|
||||
throw new ServiceException(GlobalErrorCodeConstants.UNAUTHORIZED);
|
||||
}
|
||||
return loginUser.getProductId();
|
||||
|
||||
Reference in New Issue
Block a user