version 1.342, 2003/03/19 16:50:14
|
version 1.343, 2003/03/19 21:23:03
|
Line 1875 sub eget {
|
Line 1875 sub eget {
|
sub customaccess { |
sub customaccess { |
my ($priv,$uri)=@_; |
my ($priv,$uri)=@_; |
my ($urole,$urealm)=split(/\./,$ENV{'request.role'}); |
my ($urole,$urealm)=split(/\./,$ENV{'request.role'}); |
my ($udm,$ucid,$usec)=split(/\//,$urealm); |
$urealm=~s/^\W//; |
|
my ($udom,$ucrs,$usec)=split(/\//,$urealm); |
my $access=0; |
my $access=0; |
foreach (split(/\s*\,\s*/,&metadata($uri,'rule_rights'))) { |
foreach (split(/\s*\,\s*/,&metadata($uri,'rule_rights'))) { |
my ($effect,$realm,$role)=split(/\:/,$_); |
my ($effect,$realm,$role)=split(/\:/,$_); |
foreach my $thisrealm (split(/\s*\,\s*/,$realm)) { |
if ($role) { |
&logthis('testing '.$effect.' '.$thisrealm.' '.$role); |
if ($role ne $urole) { next; } |
|
} |
|
foreach (split(/\s*\,\s*/,$realm)) { |
|
my ($tdom,$tcrs,$tsec)=split(/\_/,$_); |
|
if ($tdom) { |
|
if ($tdom ne $udom) { next; } |
|
} |
|
if ($tcrs) { |
|
if ($tcrs ne $ucrs) { next; } |
|
} |
|
if ($tsec) { |
|
if ($tsec ne $usec) { next; } |
|
} |
|
$access=($effect eq 'allow'); |
|
last; |
} |
} |
} |
} |
return $access; |
return $access; |