• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

定制ClearQuest以通过所有者、角色或组来分隔记录

发布: 2008-9-12 14:33 | 作者: Forrest Xia | 来源: IBM | 查看: 40次 | 进入软件测试论坛讨论

领测软件测试网

调用代码的一个例子,其是一个record script,名为RS_AccessControl

sub Defect_RS_AccessControl {
my($result);
my($param) = @_;
# record type name is Defect

if (ref ($param) eq "CQEventObject") {
# add your CQEventObject parameter handling code here
} elsif (ref (\$param) eq "SCALAR") {
$sessionObj = $entity->GetSession();

@params = split '\n',$param;
my $username = $params[2];
?$fieldInfo = $entity-
>GetFieldValue("Submitter");
$strSubmitterName = $fieldInfo-
>GetValue();

# test if the user belongs to group "TestManager"
$userGroups = $sessionObj->GetUserGroups();
$FlagYes = "yes";
$FlagNo = "no";
$AuthorizedUserGroup1 = "TestManager";
$AuthorizedUserGroup2 = "SuperAdmin";

$flag = $FlagNo;
if (!@$userGroups) {
$flag = $FlagNo;
} else {
foreach $strAnGroup (@$userGroups) {
if ( ($strAnGroup eq $AuthorizedUserGroup1) ||
($strAnGroup eq
$AuthorizedUserGroup2) )
{
$flag = $FlagYes;
last;
}
}
}

# test if the user is same as the
submitter or belongs to group "TestManager"
if (( $username eq $strSubmitterName)||($flag eq $FlagYes)){
$result = 1;
} else {
$result = 0;
}
} else {
# add your handling code for other type parameters here, for example:
# die("Unknown parameter type");
}
return $result;
}

  1. 使用用户组修改ACL记录类型上的所有action的控制权限,如图14所示。

图14:设置控制权限

这显示了只有在"SuperAdmin"组中的成员可以对ACL记录类型操作。

  1. 检入schema,并将此涉及应用到你的用户数据库中。
  2. 最后,ClearQuest管理员需要手工地增加一些security context记录,这些记录与每个测试人员组关联在一起(图15)。

图15:security context记录

注释:在此设计中,ACL记录的名字应当与提交者的userid完全一样。例如,在图15中,如果一个提交者的userid是xiaming,那么相应的ACL记录的名字也是xiaming。

文章来源于领测软件测试网 https://www.ltesting.net/

33/3<123

关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网