|
|
@ -423,6 +423,7 @@ public class UsersService extends BaseService { |
|
|
|
* @param projectIds project id array |
|
|
|
* @param projectIds project id array |
|
|
|
* @return grant result code |
|
|
|
* @return grant result code |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Map<String, Object> grantProject(User loginUser, int userId, String projectIds) { |
|
|
|
public Map<String, Object> grantProject(User loginUser, int userId, String projectIds) { |
|
|
|
Map<String, Object> result = new HashMap<>(5); |
|
|
|
Map<String, Object> result = new HashMap<>(5); |
|
|
|
result.put(Constants.STATUS, false); |
|
|
|
result.put(Constants.STATUS, false); |
|
|
@ -472,6 +473,7 @@ public class UsersService extends BaseService { |
|
|
|
* @param resourceIds resource id array |
|
|
|
* @param resourceIds resource id array |
|
|
|
* @return grant result code |
|
|
|
* @return grant result code |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Map<String, Object> grantResources(User loginUser, int userId, String resourceIds) { |
|
|
|
public Map<String, Object> grantResources(User loginUser, int userId, String resourceIds) { |
|
|
|
Map<String, Object> result = new HashMap<>(5); |
|
|
|
Map<String, Object> result = new HashMap<>(5); |
|
|
|
//only admin can operate
|
|
|
|
//only admin can operate
|
|
|
@ -484,9 +486,10 @@ public class UsersService extends BaseService { |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Set<Integer> needAuthorizeResIds = new HashSet(); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(resourceIds)) { |
|
|
|
String[] resourceFullIdArr = resourceIds.split(","); |
|
|
|
String[] resourceFullIdArr = resourceIds.split(","); |
|
|
|
// need authorize resource id set
|
|
|
|
// need authorize resource id set
|
|
|
|
Set<Integer> needAuthorizeResIds = new HashSet(); |
|
|
|
|
|
|
|
for (String resourceFullId : resourceFullIdArr) { |
|
|
|
for (String resourceFullId : resourceFullIdArr) { |
|
|
|
String[] resourceIdArr = resourceFullId.split("-"); |
|
|
|
String[] resourceIdArr = resourceFullId.split("-"); |
|
|
|
for (int i=0;i<=resourceIdArr.length-1;i++) { |
|
|
|
for (int i=0;i<=resourceIdArr.length-1;i++) { |
|
|
@ -494,6 +497,8 @@ public class UsersService extends BaseService { |
|
|
|
needAuthorizeResIds.add(resourceIdValue); |
|
|
|
needAuthorizeResIds.add(resourceIdValue); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//get the authorized resource id list by user id
|
|
|
|
//get the authorized resource id list by user id
|
|
|
|
List<Resource> oldAuthorizedRes = resourceMapper.queryAuthorizedResourceList(userId); |
|
|
|
List<Resource> oldAuthorizedRes = resourceMapper.queryAuthorizedResourceList(userId); |
|
|
@ -565,6 +570,7 @@ public class UsersService extends BaseService { |
|
|
|
* @param udfIds udf id array |
|
|
|
* @param udfIds udf id array |
|
|
|
* @return grant result code |
|
|
|
* @return grant result code |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Map<String, Object> grantUDFFunction(User loginUser, int userId, String udfIds) { |
|
|
|
public Map<String, Object> grantUDFFunction(User loginUser, int userId, String udfIds) { |
|
|
|
Map<String, Object> result = new HashMap<>(5); |
|
|
|
Map<String, Object> result = new HashMap<>(5); |
|
|
|
|
|
|
|
|
|
|
@ -611,6 +617,7 @@ public class UsersService extends BaseService { |
|
|
|
* @param datasourceIds data source id array |
|
|
|
* @param datasourceIds data source id array |
|
|
|
* @return grant result code |
|
|
|
* @return grant result code |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Map<String, Object> grantDataSource(User loginUser, int userId, String datasourceIds) { |
|
|
|
public Map<String, Object> grantDataSource(User loginUser, int userId, String datasourceIds) { |
|
|
|
Map<String, Object> result = new HashMap<>(5); |
|
|
|
Map<String, Object> result = new HashMap<>(5); |
|
|
|
result.put(Constants.STATUS, false); |
|
|
|
result.put(Constants.STATUS, false); |
|
|
|