Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
superrain51
apollo
提交
fea7ffe8
apollo
项目概览
superrain51
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fea7ffe8
编写于
10月 12, 2016
作者:
Z
zhangle
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
default assign modify、release namespace role to namespace creator
上级
f5dd22eb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
5 deletion
+17
-5
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/NamespaceController.java
...amework/apollo/portal/controller/NamespaceController.java
+17
-1
apollo-portal/src/main/resources/static/styles/common-style.css
...-portal/src/main/resources/static/styles/common-style.css
+0
-4
未找到文件。
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/NamespaceController.java
浏览文件 @
fea7ffe8
package
com.ctrip.framework.apollo.portal.controller
;
import
com.google.common.collect.Sets
;
import
com.ctrip.framework.apollo.common.dto.NamespaceDTO
;
import
com.ctrip.framework.apollo.common.entity.App
;
import
com.ctrip.framework.apollo.common.entity.AppNamespace
;
...
...
@@ -10,6 +12,7 @@ import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.core.utils.StringUtils
;
import
com.ctrip.framework.apollo.portal.auth.UserInfoHolder
;
import
com.ctrip.framework.apollo.portal.constant.RoleType
;
import
com.ctrip.framework.apollo.portal.entity.form.NamespaceCreationModel
;
import
com.ctrip.framework.apollo.portal.entity.vo.NamespaceVO
;
import
com.ctrip.framework.apollo.portal.listener.AppNamespaceCreationEvent
;
...
...
@@ -17,6 +20,8 @@ import com.ctrip.framework.apollo.portal.service.AppNamespaceService;
import
com.ctrip.framework.apollo.portal.service.AppService
;
import
com.ctrip.framework.apollo.portal.service.NamespaceService
;
import
com.ctrip.framework.apollo.portal.service.RoleInitializationService
;
import
com.ctrip.framework.apollo.portal.service.RolePermissionService
;
import
com.ctrip.framework.apollo.portal.util.RoleUtils
;
import
com.dianping.cat.Cat
;
import
org.slf4j.Logger
;
...
...
@@ -53,6 +58,8 @@ public class NamespaceController {
private
AppNamespaceService
appNamespaceService
;
@Autowired
private
RoleInitializationService
roleInitializationService
;
@Autowired
private
RolePermissionService
rolePermissionService
;
@RequestMapping
(
"/appnamespaces/public"
)
public
List
<
AppNamespace
>
findPublicAppNamespaces
()
{
...
...
@@ -67,9 +74,10 @@ public class NamespaceController {
checkModel
(!
CollectionUtils
.
isEmpty
(
models
));
roleInitializationService
.
initNamespaceRoles
(
appId
,
models
.
get
(
0
).
getNamespace
().
getNamespaceName
());
String
namespaceName
=
null
;
for
(
NamespaceCreationModel
model
:
models
)
{
NamespaceDTO
namespace
=
model
.
getNamespace
();
namespaceName
=
namespace
.
getNamespaceName
();
RequestPrecondition
.
checkArgumentsNotEmpty
(
model
.
getEnv
(),
namespace
.
getAppId
(),
namespace
.
getClusterName
(),
namespace
.
getNamespaceName
());
...
...
@@ -82,6 +90,14 @@ public class NamespaceController {
String
.
format
(
"create namespace fail. (env=%s namespace=%s)"
,
model
.
getEnv
(),
namespace
.
getNamespaceName
()),
e
);
}
}
//default assign modify、release namespace role to namespace creator
String
loginUser
=
userInfoHolder
.
getUser
().
getUserId
();
rolePermissionService
.
assignRoleToUsers
(
RoleUtils
.
buildNamespaceRoleName
(
appId
,
namespaceName
,
RoleType
.
MODIFY_NAMESPACE
),
Sets
.
newHashSet
(
loginUser
),
loginUser
);
rolePermissionService
.
assignRoleToUsers
(
RoleUtils
.
buildNamespaceRoleName
(
appId
,
namespaceName
,
RoleType
.
RELEASE_NAMESPACE
),
Sets
.
newHashSet
(
loginUser
),
loginUser
);
return
ResponseEntity
.
ok
().
build
();
}
...
...
apollo-portal/src/main/resources/static/styles/common-style.css
浏览文件 @
fea7ffe8
...
...
@@ -262,10 +262,6 @@ table th {
font-size
:
13px
;
}
.config-item-container
{
padding-top
:
19px
;
}
.config-item-container
.panel
{
border-radius
:
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录