权限


主体和资源的关系
id,  Ptype,    Pid,     Rtype,      Rid,     aclState
     主体类型  主体id   资源类型    资源id   acl状态值
1    1           1        0         1         00001011
2    1           1        1         1         00000001

Menu
id      sn,       name                      pos(菜单所在的导航位置)    orderNum   
1       orgType   组织结构类型管理                 nav(导航菜单)

controller
id,     sn,       name,              classname                              
1       orgType   组织机构类型管理   orgTypeController|orController(能访问)

method

id,    sn,     名称                method      pos
        add         添加                         位置


authID


实体类的创建:
package:org.xxx.sys.auth
    pachage:auth.model
        Interface:principal(声明式的接口,没有任何方法,实现)
        Class User implements principal: id, username , password, nickname, status,  主体类型常量:PRINCIPAL_TYPE="user"
        Class Role implements principal: id,name,sn,  主体类型常量:PRINCIPAL_TYPE="role"
        Class UserRole: id, User user ,Role role  用户和角色的关联表
        Interface:SystemResource(声明式的接口,没有任何方法,实现)
        Class ControllerResource implements SystemResource:id,name(中文名称,组织机构管理,用户管理),sn(资源的唯一标识,默认使用类名进行标识,XXXController),psn(父类sn),className(资源所对应的类名,有可能有多个类,所以通过|进行分割,org.konghao.sys.web.controller.OrgController|org.konghao.sys.web.controller.OrgTypeController),orderNum,ControllerResource parent(存在的意义是为了方便,在授权的时候进行选择,通过树的形式进行选择), 控制器资源   资源类型常量:RES_TYPE="controller"
        Class ServiceResource implements SystemResource:
        (RootResource)
        Class ControllerOper: controller的资源操作类,用来确定某个资源的操作所对应的方法:id,sn(资源的表示,默认就通过add,Delete,Update,read),methodName(资源的方法,一个操作默认会对应多个方法,add|addInput,在初始化的时候,可以通过方法的名称,如add开头就是add,其他没有声明的,如list,show都是READ),name,indexPos(方法的索引位置,默认情况0表示create,1表示read,2表示update,3delete,由开发人员手动指定),rid(资源id,这里不用外键关联)


        Class MenuResource implements SystemResource:









增加service operator

原文地址:https://www.cnblogs.com/mrxiaohe/p/6762348.html