本文整理汇总了Java中org.apache.shiro.authz.annotation.Logical.OR属性的典型用法代码示例。如果您正苦于以下问题:Java Logical.OR属性的具体用法?Java Logical.OR怎么用?Java Logical.OR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.shiro.authz.annotation.Logical
的用法示例。
在下文中一共展示了Logical.OR属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
@RequiresPermissions("admin:authority:sysrole:create")
@RequiresRoles(value={"Administrator","Supervisor"},logical=Logical.OR)
@RequestMapping(value = "/create", method = RequestMethod.POST, produces="application/json;charset=UTF-8")
@ResponseBody
@LogAudit
@Override
@ApiOperation(value = "创建角色", httpMethod = "POST", response = Map.class, notes = "创建角色",
produces="application/json",consumes="application/json")
public Map<String, Object> create(@RequestBody SysRole o) throws Exception {
return super.create(o);
}
示例2: update
@RequiresPermissions("admin:authority:sysrole:update")
@RequiresRoles(value={"Administrator","Supervisor"},logical=Logical.OR)
@RequestMapping(value = "/update", method = RequestMethod.POST, produces="application/json;charset=UTF-8")
@ResponseBody
@LogAudit
@Override
@ApiOperation(value = "更新角色", httpMethod = "POST", response = Map.class, notes = "更新角色",
produces="application/json",consumes="application/json")
public Map<String, Object> update(@RequestBody SysRole o) throws Exception {
return super.update(o);
}
示例3: delete
@RequiresPermissions("admin:authority:sysrole:delete")
@RequiresRoles(value={"Administrator","Supervisor"},logical=Logical.OR)
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces="application/json;charset=UTF-8")
@ResponseBody
@LogAudit
@ApiOperation(value = "删除角色", httpMethod = "POST", response = Map.class, notes = "通过主键删除角色",
produces="application/json",consumes="application/json")
public Map<String, Object> delete(@RequestBody SysRole o) throws Exception {
return super.delete(o.getId());
}
示例4: deletes
@RequiresPermissions("admin:authority:sysrole:delete")
@RequiresRoles(value={"Administrator","Supervisor"},logical=Logical.OR)
@RequestMapping(value = "/deletes", method = RequestMethod.POST, produces="application/json;charset=UTF-8")
@ResponseBody
@LogAudit
@Override
@ApiOperation(value = "删除角色", httpMethod = "POST", response = Map.class, notes = "通过主键数组删除角色",
produces="application/json",consumes="application/json")
public Map<String, Object> deletes(@RequestBody Integer[] ids) throws Exception {
return super.deletes(ids);
}
示例5: rolePermissionView
/**
* 角色资源授权
* @return
* @throws Exception
*/
@RequiresPermissions(value={"admin:authority:sysrole:create","admin:authority:sysrole:update"},logical=Logical.OR)
@RequestMapping(value = "/rolePermissionView", method = RequestMethod.GET)
@ApiOperation(value = "打开角色资源授权页面", httpMethod = "GET", response = Map.class, notes = "打开角色资源授权页面",
consumes="application/x-www-form-urlencoded")
public ModelAndView rolePermissionView() throws Exception {
return new ModelAndView("/action/admin/authority/sysrole/rolePermissionView");
}
示例6: userRoleView
/**
* 用户角色授权
* @return
* @throws Exception
*/
@RequiresPermissions(value={"admin:authority:sysuser:create","admin:authority:sysuser:update"},logical=Logical.OR)
@RequestMapping(value = "/userRoleView", method = RequestMethod.GET)
@ApiOperation(value = "打开用户角色授权页面", httpMethod = "GET", response = Map.class, notes = "打开用户角色授权页面",
consumes="application/x-www-form-urlencoded")
public ModelAndView userRoleView() throws Exception {
return new ModelAndView("/action/admin/authority/sysuser/userRoleView");
}
示例7: getUserPermissionsTreeData
/**
* 三. 穷举遍历用户权限树,用于对用户直接授权
* @param userId
* @return
* @throws Exception
*/
@RequiresPermissions(value={"admin:authority:sysuser:create","admin:authority:sysuser:update"},logical=Logical.OR)
@RequestMapping(value = "/userPermission/getPermissionsTreeData/{userId}", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "穷举遍历用户权限树,用于对用户直接授权", httpMethod = "POST", response = Map.class, notes = "穷举遍历用户权限树,用于对用户直接授权",
produces="application/json",consumes="application/x-www-form-urlencoded")
public Map<String, Object> getUserPermissionsTreeData(@ApiParam(required=true, value="用户Id")@PathVariable("userId") Integer userId) throws Exception {
SecurityUtils.getSubject().checkRole("Administrator");
return sysUserAdvanceService.getUserPermissionsTreeData(userId);
}
示例8: index
@RequiresRoles(value = { "管理员", "超级管理员" }, logical = Logical.OR)
public void index() {
int pageNum = Convert.toInteger(getPara("pageNumber", "1"));
int pageSize = Convert.toInteger(getPara("pageSize", String.valueOf(_defaultNumPerPage)));
Page<User> UserPage = BGDispatch.userService.query_sort(pageNum, pageSize, getUser());
if (UserPage != null) {
setPage(UserPage);
setAttr("UserPage", UserPage);
setAttr("pageUrl", "/user");
}
this.setAttr("page", 3);
render("userList.jsp");
}
示例9: list
@RequiresRoles(value = { "Admin", "User" }, logical = Logical.OR)
@RequestMapping(value = "")
public String list(Model model, ServletRequest request) {
Map<String, Object> searchParams = Servlets.getParametersStartingWith(request, "search_");
List<User> users = accountService.searchUser(searchParams);
model.addAttribute("users", users);
model.addAttribute("allStatus", allStatus);
return "account/userList";
}
示例10: openFormView
@RequiresPermissions(value={"admin:authority:sysrole:create","admin:authority:sysrole:update"},logical=Logical.OR)
@RequestMapping(value = "/sysRoleForm", method = RequestMethod.GET)
public ModelAndView openFormView(Date ssDate, Date eeDate) throws Exception {
return super.openFormView(ssDate, eeDate);
}
示例11: submit
/**
* 提交保存权限树
* @param roleId 角色Id
* @param permissionIds 资源权限Id
* @return
*/
@RequiresPermissions("admin:authority:sysuser:userRole:update")
@RequiresRoles(value={"Administrator","Supervisor"},logical=Logical.OR)
@RequestMapping(value = "/rolePermission/submit", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "提交保存权限", httpMethod = "POST", response = Map.class, notes = "提交保存权限",
produces="application/json",consumes="application/x-www-form-urlencoded")
public Map<String, Object> submit(@ApiParam(required=true, value="角色Id")@RequestParam("roleId") Integer roleId,
@ApiParam(required=true, value="权限Id数组")@RequestParam("permissionIds") String permissionIds) {
Map<String, Object> map = Maps.newHashMap();
try {
if (roleId == null) { // 删除角色所有权限
map.put("responseid", 0);
map.put("message", "请选择有效角色!");
} else {
sysRoleAdvanceService.clearCacheHolder();
if(StringUtils.isEmpty(permissionIds)){
sysRoleAdvanceService.deleteSysRolePermissionByRoleId(roleId); // 根据roleId删除该角色下面的所有权限
}else{
String[] permissionStrings = permissionIds.split(Constants.SPACE);
if (permissionStrings != null && permissionStrings.length > 0) {
Set<String> permissionSet = new HashSet<String>();
sysRoleAdvanceService.deleteSysRolePermissionByRoleId(roleId); //根据角色删除所有权限
for (String add : permissionStrings) {
permissionSet.add(add); //使用Set接口过滤去重权限
}
for (String permission : permissionSet) {
sysRoleAdvanceService.createSysRolePermission(roleId, Integer.parseInt(permission));
}
}
}
}
map.put("responseid", 1);
map.put("message", "保存角色权限成功!");
} catch (Exception e) {
map.put("responseid", 0);
map.put("message", "保存角色权限失败!");
log.error(Exceptions.getStackTraceAsString(e));
}
return map;
}
示例12: openFormView
@RequiresPermissions(value={"admin:authority:syspermission:create","admin:authority:syspermission:update"},logical=Logical.OR)
@RequestMapping(value = "/sysPermissionForm", method = RequestMethod.GET)
public ModelAndView openFormView(Date ssDate, Date eeDate) throws Exception {
return super.openFormView(ssDate, eeDate);
}
示例13: openFormView
@RequiresPermissions(value={"admin:authority:sysuser:create","admin:authority:sysuser:update"},logical=Logical.OR)
@RequestMapping(value = "/sysUserForm", method = RequestMethod.GET)
public ModelAndView openFormView(Date ssDate, Date eeDate) throws Exception {
return super.openFormView(ssDate, eeDate);
}
示例14: openFormView
@RequiresPermissions(value={"admin:authority:sysorg:create","admin:authority:sysorg:update"},logical=Logical.OR)
@RequestMapping(value = "/sysOrgForm", method = RequestMethod.GET)
public ModelAndView openFormView(Date ssDate, Date eeDate) throws Exception {
return super.openFormView(ssDate, eeDate);
}
示例15: delete
@RequiresRoles(value = { "ROLE_ADMIN", "ROLE_SUPERADMIN" }, logical = Logical.OR)
public void delete() {
User.dao.deleteById(getParaToInt());
redirect("/user");
}