You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
40 lines
1.3 KiB
3 years ago
|
/*
|
||
|
* Copyright (C), 2018-2021
|
||
|
* Project: starter
|
||
|
* FileName: DingTalkAuthorityUtils
|
||
|
* Author: Louis
|
||
|
* Date: 2021/6/24 22:23
|
||
|
*/
|
||
|
package com.fr.plugin.xxxx.dingtalksyn.utils;
|
||
|
|
||
|
import com.fanruan.api.log.LogKit;
|
||
|
import com.fr.decision.authority.base.constant.type.authority.ViewAuthorityType;
|
||
|
import com.fr.decision.config.FSConfig;
|
||
|
import com.fr.decision.webservice.utils.ControllerFactory;
|
||
|
import com.fr.decision.webservice.v10.user.UserService;
|
||
|
import com.fr.license.function.VT4FR;
|
||
|
|
||
|
/**
|
||
|
* <Function Description><br>
|
||
|
* <DingTalkAuthorityUtils>
|
||
|
*
|
||
|
* @author fr.open
|
||
|
* @since 1.0.0
|
||
|
*/
|
||
|
public class DingTalkAuthorityUtils {
|
||
|
public DingTalkAuthorityUtils() {
|
||
|
}
|
||
|
|
||
|
public static boolean hasModulePrivilege(String userId, String entityId) throws Exception {
|
||
|
try {
|
||
|
if (UserService.getInstance().isAdmin(userId)) {
|
||
|
return true;
|
||
|
} else {
|
||
|
return VT4FR.MultiPrivilege.isSupport() && FSConfig.getInstance().getAuthorizeAttr().isGradeAuthority() && ControllerFactory.getInstance().getEntryController(userId).doesUserHasEntityAuth(userId, entityId, ViewAuthorityType.TYPE);
|
||
|
}
|
||
|
} catch (Exception e) {
|
||
|
LogKit.error(e.getMessage(), e);
|
||
|
throw e;
|
||
|
}
|
||
|
}
|
||
|
}
|