pull/3/head
rekoe 2016-03-27 16:31:20 +08:00
parent 38d8857138
commit 1f9fdd8bd3
2 changed files with 16 additions and 6 deletions

View File

@ -119,8 +119,7 @@ public class AdminProjectAct extends BaseAction {
@At @At
@Ok("fm:template.admin.project.pjauth") @Ok("fm:template.admin.project.pjauth")
@RequiresPermissions({ "svn.project:view" }) @RequiresPermissions({ "svn.project:view" })
public String pjauth(@Param("pj") String pj, @Param("res") String res, HttpServletRequest req) { public String pjauth(@Param("pj") String pj, @Param("res") String res, @Param("entity") PjAuth entity, HttpServletRequest req) {
PjAuth entity = (PjAuth) req.getAttribute("entity");
if (entity == null) { if (entity == null) {
entity = new PjAuth(); entity = new PjAuth();
entity.setPj(pj); entity.setPj(pj);
@ -136,7 +135,7 @@ public class AdminProjectAct extends BaseAction {
} else { } else {
res = entity.getRes(); res = entity.getRes();
} }
String root = projectConfigService.get().getRepositoryPath()+"/"; String root = projectConfigService.get().getRepositoryPath() + "/";
res = StringUtils.remove(res, root); res = StringUtils.remove(res, root);
entity.setRes(res); entity.setRes(res);
List<PjAuth> list = projectAuthService.list(pj, res); List<PjAuth> list = projectAuthService.list(pj, res);
@ -186,7 +185,7 @@ public class AdminProjectAct extends BaseAction {
} else if (StringUtils.isNotBlank(usr)) { } else if (StringUtils.isNotBlank(usr)) {
projectAuthService.deleteByUsr(pj, usr, res); projectAuthService.deleteByUsr(pj, usr, res);
} }
return pjauth(pj, res, Mvcs.getReq()); return pjauth(pj, res, null, Mvcs.getReq());
} }
@Inject @Inject
@ -221,4 +220,16 @@ public class AdminProjectAct extends BaseAction {
return Message.success("ok", req); return Message.success("ok", req);
} }
@At("/pjauth/save")
@Ok("fm:template.admin.project.pjauth")
@RequiresPermissions({ "svn.project:auth.manager" })
@PermissionTag(name = "管理项目权限", tag = "SVN项目管理", enable = false)
public String pjauth_save(@Param("rw") String rw, @Param("grs") String[] grs, @Param("pj") String pj, @Param("res") String res, @Param("usrs") String[] usrs) {
PjAuth entity = new PjAuth();
entity.setPj(pj);
entity.setRes(res);
Mvcs.getReq().setAttribute("entity", entity);
projectAuthService.save(pj, res, rw, grs, usrs);
return pjauth(pj, res, entity, Mvcs.getReq());
}
} }

View File

@ -86,8 +86,7 @@
</script> </script>
</head> </head>
<body style="margin: 0px;"> <body style="margin: 0px;">
<form name="pjauth" action="pjauth" method="post" onsubmit="return checkForm(this);"> <form name="pjauth" action="pjauth/save" method="post" onsubmit="return checkForm(this);">
<input type="hidden" name="act" value="save">
<input type="hidden" name="pj" value="${pj}"> <input type="hidden" name="pj" value="${pj}">
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<tr> <tr>