Search in sources :

Example 1 with PermissionExample

use of com.ganster.cms.core.pojo.PermissionExample in project Ganster-CMS by Gangster-trio.

the class AllotPermissionController method addPermission.

@RequestMapping("/add")
@RequiresPermissions("add")
public void addPermission(@RequestParam("GroupName") String groupName, @RequestParam("PermissionName") String permissionName) throws PermissionNotFoundException, GroupNotFountException {
    PermissionExample permissionExample = new PermissionExample();
    permissionExample.createCriteria().andPermissionNameEqualTo(permissionName);
    List<Permission> permissions = permissionService.selectByExample(permissionExample);
    if (permissions == null)
        throw new PermissionNotFoundException();
    for (Permission i : permissions) {
    // groupService.addCategoryPermissionToGroup(i.getPermissionName(),groupName);
    }
}
Also used : Permission(com.ganster.cms.core.pojo.Permission) PermissionNotFoundException(com.ganster.cms.core.exception.PermissionNotFoundException) PermissionExample(com.ganster.cms.core.pojo.PermissionExample) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

PermissionNotFoundException (com.ganster.cms.core.exception.PermissionNotFoundException)1 Permission (com.ganster.cms.core.pojo.Permission)1 PermissionExample (com.ganster.cms.core.pojo.PermissionExample)1 RequiresPermissions (org.apache.shiro.authz.annotation.RequiresPermissions)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1