授权改为按钮权限
This commit is contained in:
parent
5b7d9e8a04
commit
2403c05b27
zheng-upms/zheng-upms-server/src/main
java/com/zheng/upms/server/controller/manage
webapp/WEB-INF/jsp/manage
|
@ -46,6 +46,15 @@ public class UpmsRoleController extends BaseController {
|
|||
return "/manage/role/index";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色授权")
|
||||
@RequiresPermissions("upms:role:permission")
|
||||
@RequestMapping(value = "/permission/{id}", method = RequestMethod.GET)
|
||||
public String permission(@PathVariable("id") int id, ModelMap modelMap) {
|
||||
UpmsRole role = upmsRoleService.selectByPrimaryKey(id);
|
||||
modelMap.put("role", role);
|
||||
return "/manage/role/permission";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色列表")
|
||||
@RequiresPermissions("upms:role:read")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
|
|
|
@ -47,6 +47,15 @@ public class UpmsUserController extends BaseController {
|
|||
return "/manage/user/index";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户授权")
|
||||
@RequiresPermissions("upms:user:permission")
|
||||
@RequestMapping(value = "/permission/{id}", method = RequestMethod.GET)
|
||||
public String permission(@PathVariable("id") int id, ModelMap modelMap) {
|
||||
UpmsUser user = upmsUserService.selectByPrimaryKey(id);
|
||||
modelMap.put("user", user);
|
||||
return "/manage/user/permission";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户列表")
|
||||
@RequiresPermissions("upms:user:read")
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<shiro:hasPermission name="upms:role:create"><a class="waves-effect waves-button" href="javascript:;" onclick="createAction()"><i class="zmdi zmdi-plus"></i> 新增角色</a></shiro:hasPermission>
|
||||
<shiro:hasPermission name="upms:role:update"><a class="waves-effect waves-button" href="javascript:;" onclick="updateAction()"><i class="zmdi zmdi-edit"></i> 编辑角色</a></shiro:hasPermission>
|
||||
<shiro:hasPermission name="upms:role:delete"><a class="waves-effect waves-button" href="javascript:;" onclick="deleteAction()"><i class="zmdi zmdi-close"></i> 删除角色</a></shiro:hasPermission>
|
||||
<shiro:hasPermission name="upms:role:permission"><a class="waves-effect waves-button" href="javascript:;" onclick="permissionAction()"><i class="zmdi zmdi-key"></i> 角色授权</a></shiro:hasPermission>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
@ -206,6 +207,34 @@ function deleteAction() {
|
|||
});
|
||||
}
|
||||
}
|
||||
// 授权
|
||||
var permissionDialog;
|
||||
function permissionAction() {
|
||||
var rows = $table.bootstrapTable('getSelections');
|
||||
if (rows.length != 1) {
|
||||
$.confirm({
|
||||
title: false,
|
||||
content: '请选择一条记录!',
|
||||
autoClose: 'cancel|3000',
|
||||
backgroundDismiss: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: '取消',
|
||||
btnClass: 'waves-effect waves-button'
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
permissionDialog = $.dialog({
|
||||
animationSpeed: 300,
|
||||
title: '角色授权',
|
||||
content: 'url:${basePath}/manage/role/permission/' + rows[0].roleId,
|
||||
onContentReady: function () {
|
||||
initMaterialInput();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -21,6 +21,7 @@
|
|||
<shiro:hasPermission name="upms:user:create"><a class="waves-effect waves-button" href="javascript:;" onclick="createAction()"><i class="zmdi zmdi-plus"></i> 新增用户</a></shiro:hasPermission>
|
||||
<shiro:hasPermission name="upms:user:update"><a class="waves-effect waves-button" href="javascript:;" onclick="updateAction()"><i class="zmdi zmdi-edit"></i> 编辑用户</a></shiro:hasPermission>
|
||||
<shiro:hasPermission name="upms:user:delete"><a class="waves-effect waves-button" href="javascript:;" onclick="deleteAction()"><i class="zmdi zmdi-close"></i> 删除用户</a></shiro:hasPermission>
|
||||
<shiro:hasPermission name="upms:user:permission"><a class="waves-effect waves-button" href="javascript:;" onclick="permissionAction()"><i class="zmdi zmdi-key"></i> 用户授权</a></shiro:hasPermission>
|
||||
</div>
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
@ -232,6 +233,34 @@ function deleteAction() {
|
|||
});
|
||||
}
|
||||
}
|
||||
// 授权
|
||||
var permissionDialog;
|
||||
function permissionAction() {
|
||||
var rows = $table.bootstrapTable('getSelections');
|
||||
if (rows.length != 1) {
|
||||
$.confirm({
|
||||
title: false,
|
||||
content: '请选择一条记录!',
|
||||
autoClose: 'cancel|3000',
|
||||
backgroundDismiss: true,
|
||||
buttons: {
|
||||
cancel: {
|
||||
text: '取消',
|
||||
btnClass: 'waves-effect waves-button'
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
permissionDialog = $.dialog({
|
||||
animationSpeed: 300,
|
||||
title: '用户授权',
|
||||
content: 'url:${basePath}/manage/user/permission/' + rows[0].userId,
|
||||
onContentReady: function () {
|
||||
initMaterialInput();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue