Search in sources :

Example 1 with SysRole

use of com.artlongs.sys.model.SysRole in project act-eagle-allone by mailtous.

the class SysRoleController method edit.

@GetAction("edit_box/{id}")
public RenderAny edit(@Param(defLongVal = -1) Long id) {
    SysRole sysRole = new SysRole();
    // -1:新增
    sysRole.setId(id);
    if (id > 0) {
        sysRole = sysRoleService.get(new Long(id));
    }
    return render("edit_box.html", sysRole);
}
Also used : SysRole(com.artlongs.sys.model.SysRole) GetAction(org.osgl.mvc.annotation.GetAction)

Example 2 with SysRole

use of com.artlongs.sys.model.SysRole in project act-eagle-allone by mailtous.

the class SysUserController method role_edit.

/**
 * 角色分配窗口页
 * @param id
 * @return
 */
@GetAction("role_box/{userId}")
public RenderAny role_edit(Long userId) {
    SysUser sysUser = sysUserService.get(userId);
    List<SysRole> sysRoleList = sysRoleService.getAllOfList();
    ctx.renderArg("sysRoleList", sysRoleList);
    ctx.renderArg("sysUser", sysUser);
    ctx.renderArg("roleMap", sysUser.hasRoleMap());
    return render("role_box.html");
}
Also used : SysUser(com.artlongs.sys.model.SysUser) SysRole(com.artlongs.sys.model.SysRole) GetAction(org.osgl.mvc.annotation.GetAction)

Example 3 with SysRole

use of com.artlongs.sys.model.SysRole in project act-eagle-allone by mailtous.

the class SysFuncController method perm_edit.

/**
 * 权限分配窗口页
 * @param id
 * @return
 */
@GetAction("perm_box/{funcId}")
public RenderAny perm_edit(Long funcId) {
    SysFunc sysFunc = sysFuncService.get(new Long(funcId));
    List<SysRole> sysRoleList = sysRoleService.getAllOfList();
    List<Long> roleIds = sysPermissionService.getRoleIdsOfFuncId(funcId);
    Map<Long, Boolean> roleMap = sysPermissionService.roleMapOfpermission(roleIds);
    ctx.renderArg("sysRoleList", sysRoleList);
    ctx.renderArg("sysFunc", sysFunc);
    ctx.renderArg("roleMap", roleMap);
    return render("perm_box.html");
}
Also used : SysFunc(com.artlongs.sys.model.SysFunc) SysRole(com.artlongs.sys.model.SysRole) GetAction(org.osgl.mvc.annotation.GetAction)

Example 4 with SysRole

use of com.artlongs.sys.model.SysRole in project act-eagle-allone by mailtous.

the class SysRoleService method realDel.

public R realDel(Long id) {
    SysRole sysRole = get(id);
    if (null == sysRole) {
        return R.fail("找不到对应的角色!");
    }
    List<SysPermission> permissionList = permissionService.getPermissionList(id);
    if (C.notEmpty(permissionList)) {
        return R.fail("角色已经分配了权限,不允许删除。");
    }
    return R.tf(sysRoleDao.realDel(id));
}
Also used : SysRole(com.artlongs.sys.model.SysRole) SysPermission(com.artlongs.sys.model.SysPermission)

Aggregations

SysRole (com.artlongs.sys.model.SysRole)4 GetAction (org.osgl.mvc.annotation.GetAction)3 SysFunc (com.artlongs.sys.model.SysFunc)1 SysPermission (com.artlongs.sys.model.SysPermission)1 SysUser (com.artlongs.sys.model.SysUser)1