From 71d6a20a884d797dac30f1e1be8f6226ddebd734 Mon Sep 17 00:00:00 2001 From: xxxllluuu Date: Fri, 22 May 2020 18:06:37 +0800 Subject: [PATCH] https://github.com/edp963/davinci/issues/1757 1. bug fix --- .../java/edp/davinci/service/impl/ProjectServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/edp/davinci/service/impl/ProjectServiceImpl.java b/server/src/main/java/edp/davinci/service/impl/ProjectServiceImpl.java index 546eb9dc7..860822481 100644 --- a/server/src/main/java/edp/davinci/service/impl/ProjectServiceImpl.java +++ b/server/src/main/java/edp/davinci/service/impl/ProjectServiceImpl.java @@ -242,7 +242,11 @@ private Organization getOrganization(Long id) { private void checkOwner(Organization organization, Long userId, Long id, String operation) { RelUserOrganization rel = relUserOrganizationMapper.getRel(userId, id); - if (!organization.getUserId().equals(userId) + if (rel != null && organization.getAllowCreateProject()) { + return; + } + + if (!organization.getUserId().equals(userId) && (null == rel || rel.getRole() != UserOrgRoleEnum.OWNER.getRole())) { throw new UnAuthorizedExecption("you have not permission to " + operation + " this project"); }