@Service public class RoleService extends AbstractBaseDomainObjectService<Role,RoleEntity> implements IRoleService
domainObjectClass, entityClass
构造器和说明 |
---|
RoleService() |
限定符和类型 | 方法和说明 |
---|---|
void |
assignPermission(long roleId,
List<Long> permissionIds)
为该角色分配权限
|
void |
assignUser(long roleId,
List<Long> userIds)
为角色分配用户
|
Role |
getByName(String roleName)
通过名称检索角色
|
protected IBaseEntityHandler<RoleEntity> |
getEntityHandler() |
List<Role> |
listByUserId(long userId)
根据用户Id查询所有角色
|
List<String> |
listRoleNamesByUserId(long userId)
根据用户Id查询所有角色
|
countByFilter, createClientObject, createClientObject, createClientObjects, createClientObjects, createFilter, delete, deleteById, deleteByIds, getByFilter, getById, getByIdAndEvict, getInternalEntities, getInternalEntity, getObjectType, list, list, listByFilter, listSimpleData, pagingByFilter, save, saveAll
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countByFilter, createFilter, delete, deleteById, deleteByIds, getByFilter, getById, getByIdAndEvict, list, list, listByFilter, listSimpleData, pagingByFilter, save, saveAll
protected IBaseEntityHandler<RoleEntity> getEntityHandler()
public void assignUser(long roleId, List<Long> userIds)
IRoleService
assignUser
在接口中 IRoleService
roleId
- 角色的IDuserIds
- 用户的ID列表public void assignPermission(long roleId, List<Long> permissionIds)
IRoleService
assignPermission
在接口中 IRoleService
roleId
- 角色的IDpermissionIds
- 权限的ID列表public Role getByName(String roleName)
IRoleService
getByName
在接口中 IRoleService
roleName
- 角色的名字,在角色中全局唯一public List<String> listRoleNamesByUserId(long userId)
listRoleNamesByUserId
在接口中 IRoleService
userId
- public List<Role> listByUserId(long userId)
IRoleService
listByUserId
在接口中 IRoleService
Copyright © 2019. All rights reserved.