fixing a problem where privileges showed when they shouldn't

This commit is contained in:
JT Smith 2003-06-25 01:05:01 +00:00
parent 7092a296a0
commit 0fda9559d6

View file

@ -1383,53 +1383,55 @@ sub www_edit {
-value=>$endDate,
-uiLevel=>6
);
#Added By Frank Dillon - Wobject Privilege
my $subtext;
if (WebGUI::Privilege::isInGroup(3)) {
$subtext = ' &nbsp; <a href="'.WebGUI::URL::page('op=listUsers').'">'.WebGUI::International::get(7).'</a>';
} else {
$subtext = "";
}
my $clause;
if (WebGUI::Privilege::isInGroup(3)) {
my $contentManagers = WebGUI::Grouping::getUsersInGroup(4,1);
push (@$contentManagers, $session{user}{userId});
$clause = "userId in (".join(",",@$contentManagers).")";
} else {
$clause = "userId=".$_[0]->get("ownerId");
}
my $users = WebGUI::SQL->buildHashRef("select userId,username from users where $clause order by username");
$f->getTab("privileges")->select(
-name=>"ownerId",
-options=>$users,
-label=>WebGUI::International::get(108),
-value=>[$_[0]->getValue("ownerId")],
-subtext=>$subtext,
-uiLevel=>6
);
if (WebGUI::Privilege::isInGroup(3)) {
$subtext = ' &nbsp; <a href="'.WebGUI::URL::page('op=listGroups').'">'.WebGUI::International::get(5).'</a>';
}
if ($session{setting}{wobjectPrivileges}) {
my $clause;
if (WebGUI::Privilege::isInGroup(3)) {
my $contentManagers = WebGUI::Grouping::getUsersInGroup(4,1);
push (@$contentManagers, $session{user}{userId});
$clause = "userId in (".join(",",@$contentManagers).")";
} else {
$clause = "userId=".$_[0]->get("ownerId");
}
my $users = WebGUI::SQL->buildHashRef("select userId,username from users where $clause order by username");
$f->getTab("privileges")->select(
-name=>"ownerId",
-options=>$users,
-label=>WebGUI::International::get(108),
-value=>[$_[0]->getValue("ownerId")],
-subtext=>$subtext,
-uiLevel=>6
);
if (WebGUI::Privilege::isInGroup(3)) {
$subtext = ' &nbsp; <a href="'.WebGUI::URL::page('op=listGroups').'">'.WebGUI::International::get(5).'</a>';
} else {
$subtext = "";
}
$f->getTab("privileges")->group(
-name=>"groupIdView",
-label=>WebGUI::International::get(872),
-value=>[$_[0]->getValue("groupIdView")],
-subtext=>$subtext,
-uiLevel=>6
);
$f->getTab("privileges")->group(
-name=>"groupIdEdit",
-label=>WebGUI::International::get(871),
-value=>[$_[0]->getValue("groupIdEdit")],
-subtext=>$subtext,
-excludeGroups=>[1,7],
-uiLevel=>6
);
} else {
$subtext = "";
$f->hidden({name=>"ownerId",value=>$_[0]->getValue("ownerId")});
$f->hidden({name=>"groupIdView",value=>$_[0]->getValue("groupIdView")});
$f->hidden({name=>"groupIdEdit",value=>$_[0]->getValue("groupIdEdit")});
}
$f->getTab("privileges")->group(
-name=>"groupIdView",
-label=>WebGUI::International::get(872),
-value=>[$_[0]->getValue("groupIdView")],
-subtext=>$subtext,
-uiLevel=>6
);
$f->getTab("privileges")->group(
-name=>"groupIdEdit",
-label=>WebGUI::International::get(871),
-value=>[$_[0]->getValue("groupIdEdit")],
-subtext=>$subtext,
-excludeGroups=>[1,7],
-uiLevel=>6
);
#End Frank Dillon Changes
$f->getTab("properties")->HTMLArea(
-name=>"description",
-label=>WebGUI::International::get(85),