packageutil setaccess -dbset dbset_name user_name password schema_name -record -modifiablebyothers OSLCLink
例如:
packageutil setaccess –dbset 7.0.0 admin "" ALM -record -modifiablebyothers OSLCLink
显示输出可能与以下类似:
--- Checked out revision 3 of schema 'ALM'
+++ Set access policy for OSLCLink to -modifiablebyothers
+++ Set access policy for select records, fields, and actions
sub OSLC_GetSecurityFieldName
{
my $security_fieldname = "";
my ($entitydef_name) = @_;
# A hash table to keep security field name of each
# entitydef, using entitydef name as the key and security
# field name as the value.
my %security_fields_hash = (
#add entitydef and security context field pairs here
#For example, "ALMTask" => "SecurityPolicy"
);
if (exists $security_fields_hash{$entitydef_name}) {
my $temp_security_fieldname = $security_fields_hash{$entitydef_name};
if (
$::session->GetEntityDef($entitydef_name)->IsSecurityContextField($temp_security_fieldname)) {
$security_fieldname = $temp_security_fieldname;
}
}
return $security_fieldname;
}
挂钩将返回指定记录类型的安全上下文字段名称。
例如,如果向 ALMTask 和 ALMRequest 记录类型(其安全上下文字段均命名为 SecurityPolicy)应用了 OSLCLink 软件包,并且在步骤 2 中添加的 REFERENCE 字段命名为 oslc_SecurityPolicy,那么您的 %security_fields_hash 表看起来可能如下:
my %security_fields_hash = (
"OSLCLink" => "oslc_SecurityPolicy",
"ALMTask" => "SecurityPolicy",
"ALMRequest" => "SecurityPolicy"
packageutil setaccess -dbset dbset_name user_name password schema_name -record -modifiablebyothers OSLCLink
例如:
packageutil setaccess –dbset 7.0.0 admin "" ALM -record -modifiablebyowner OSLCLink
显示输出可能与以下类似:
--- Checked out revision 4 of schema 'ALM'
+++ Set access policy for OSLCLink to -modifiablebyowner
+++ Set access policy for select records, fields, and actions