table user 用户表
userid
usernamerole 角色表
roleid
rolenameuser_role 用户+角色表关系
userid
roleidfun 功能表也叫权限表
funid
funnamefun_role 权限和角色表关系
funid;
roleid;要查询一个用户有哪些角色
select * from user_role where userid ='';
查询'jason'有哪些角色
select * from t_role where roleid in(select roleid from t_user_role where userid =(select userid from t_user where username='jason'))
查询'jason'有哪写功能操作.
select * from t_function where funid in(select funid from t_function_role where roleid in ( select roleid from t_user_role where userid =01)).我目前只能想到这些功能了,请大家看看能够否满足目前J2EE系统里的多角色权限问题,也请大家多多指教.