fix: unshare

This commit is contained in:
RB 2022-05-18 13:29:47 +08:00
parent d31e53a212
commit ac17a79395
2 changed files with 8 additions and 4 deletions
src/main/java/com/rebuild

View file

@ -299,6 +299,11 @@ public class PrivilegesManager {
return true; return true;
} }
// 取消共享与共享共用权限
if (action == EntityService.UNSHARE) {
action = BizzPermission.SHARE;
}
// 明细无 分派/共享 // 明细无 分派/共享
if (entity.getMainEntity() != null) { if (entity.getMainEntity() != null) {
if (action == BizzPermission.ASSIGN || action == BizzPermission.SHARE) { if (action == BizzPermission.ASSIGN || action == BizzPermission.SHARE) {

View file

@ -277,15 +277,14 @@ public class GeneralOperatingController extends BaseController {
} }
@PostMapping("record-unshare") @PostMapping("record-unshare")
public JSONAware unsharesa(@IdParam(name = "record") ID recordId, HttpServletRequest request) { public JSONAware unshare(@IdParam(name = "record") ID recordId, HttpServletRequest request) {
final ID user = getRequestUser(request); final ID user = getRequestUser(request);
final ID[] accessIds = parseIdList(request); // ShareAccess IDs final ID[] accessIds = parseIdList(request); // ShareAccess IDs
if (accessIds.length == 0) { if (accessIds.length == 0) {
return RespBody.errorl("没有要取消共享的记录"); return RespBody.errorl("没有要取消共享的记录");
} }
final ID firstId = accessIds[0]; final Entity entity = MetadataHelper.getEntity(recordId.getEntityCode());
final Entity entity = MetadataHelper.getEntity(firstId.getEntityCode());
final EntityService ies = Application.getEntityService(entity.getEntityCode()); final EntityService ies = Application.getEntityService(entity.getEntityCode());
int affected; int affected;
@ -321,7 +320,7 @@ public class GeneralOperatingController extends BaseController {
StringUtils.join(records, "','")); StringUtils.join(records, "','"));
String to = getParameterNotNull(request, "to"); String to = getParameterNotNull(request, "to");
// 非全部 // 指定用户/全部
if (!"$ALL$".equals(to)) { if (!"$ALL$".equals(to)) {
ID[] toUsers = parseUserList(request); ID[] toUsers = parseUserList(request);
if (toUsers.length == 0) { if (toUsers.length == 0) {