Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3250714
  • 博文数量: 530
  • 博客积分: 13360
  • 博客等级: 上将
  • 技术积分: 5473
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-13 13:32
文章分类

全部博文(530)

文章存档

2017年(1)

2015年(2)

2013年(24)

2012年(20)

2011年(97)

2010年(240)

2009年(117)

2008年(12)

2007年(8)

2006年(9)

分类: Java

2009-11-30 18:30:31

1.jbpm4权限管理简介
   jbpm4权限管理,数据库内共有三个表:Entity、 Membership、 Group、 User,其关系如下:
  
   我现在做的系统里要用jbpm,所以一直想用Group类中的groupType来表示角色,User类表示用户,Group表示部门或用户组。但查看网上资料,大家都说是用Membership类中的Name来表示角色,由于没有实践,这里暂不发表评论。


1.用户组和用户操作接口
package org.jbpm.api.identity
   在这个包下面有二个接口:Group和User。分别定义了用户组和用户的行为。
 
public interface Group {
 
  /**用户组ID必须唯一*/
  String getId();

  /** 在一个工作组类型内必须唯一*/
  String getName();
 
  /** 获取工作组类型 */
  String getType();
}

public interface User {

  /** 用户ID必须唯一 */
  String getId();
 
  /** 获取用户的名 */
  String getGivenName();

  /** 获取用户的姓 */
  String getFamilyName();

  /** 获取用户的email */
  String getBusinessEmail();
}
这二个接口在org.jbpm.pvm.internal.identity.impl包中被实现,具体关系如下
    Group:GroupImpl
    User:UserImpl

2.用户组和用户操作实现
   org.jbpm.pvm.internal.identity.impl
   GroupImpl 和UserImpl 只相当于一个数据model类

注:下面去掉了不必要的代码
public class UserImpl implements User, Serializable {

  protected long dbid;
  protected int dbversion;

  protected String id;
  protected String password;
  protected String givenName;
  protected String familyName;
  protected String businessEmail;

 
  public UserImpl(String id, String givenName, String familyName) {
    this.id = id;
    this.givenName = givenName;
    this.familyName = familyName;
  }
}

public class GroupImpl implements Group, Serializable {
  protected long dbid;
  protected int dbversion;

  protected GroupImpl parent;

  protected String id;
  protected String name;
  protected String type;
}

类IdentitySessionImpl 相当于command模式中的Receiver,即具体的执行者
public class IdentitySessionImpl implements IdentitySession {

 
待续

参考文献







阅读(3143) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-12-23 15:43:59

继续下文呀,本人正需要这方面的资料 谢谢