fixed #10133: Matrix compare for priv. group open to any user
This commit is contained in:
parent
beb9b77440
commit
43f09b433f
5 changed files with 64 additions and 0 deletions
|
|
@ -230,6 +230,19 @@ sub definition {
|
|||
hoverHelp =>$i18n->get('max comparisons privileged description'),
|
||||
label =>$i18n->get('max comparisons privileged label'),
|
||||
},
|
||||
maxComparisonsGroup=>{
|
||||
fieldType =>"group",
|
||||
tab =>"properties",
|
||||
hoverHelp =>$i18n->get('maxgroup description'),
|
||||
label =>$i18n->get('maxgroup label'),
|
||||
},
|
||||
maxComparisonsGroupInt=>{
|
||||
fieldType =>"integer",
|
||||
tab =>"properties",
|
||||
defaultValue =>25,
|
||||
hoverHelp =>$i18n->get('maxgroup per description'),
|
||||
label =>$i18n->get('maxgroup per label'),
|
||||
},
|
||||
groupToAdd=>{
|
||||
fieldType =>"group",
|
||||
tab =>"security",
|
||||
|
|
@ -454,6 +467,9 @@ sub getCompareForm {
|
|||
if($self->session->user->isVisitor){
|
||||
$maxComparisons = $self->get('maxComparisons');
|
||||
}
|
||||
elsif($self->session->user->isInGroup( $self->get("maxComparisonsGroup") )) {
|
||||
$maxComparisons = $self->get('maxComparisonsGroupInt');
|
||||
}
|
||||
else{
|
||||
$maxComparisons = $self->get('maxComparisonsPrivileged');
|
||||
}
|
||||
|
|
@ -627,6 +643,21 @@ sub view {
|
|||
$var->{listAttributes_url} = $self->getUrl('func=listAttributes');
|
||||
$var->{search_url} = $self->getUrl('func=search');
|
||||
$var->{compareForm_url} = $self->getUrl();
|
||||
|
||||
my $maxComparisons;
|
||||
if($self->session->user->isVisitor){
|
||||
$maxComparisons = $self->get('maxComparisons');
|
||||
}
|
||||
elsif($self->session->user->isInGroup( $self->get("maxComparisonsGroup") )) {
|
||||
$maxComparisons = $self->get('maxComparisonsGroupInt');
|
||||
}
|
||||
else{
|
||||
$maxComparisons = $self->get('maxComparisonsPrivileged');
|
||||
}
|
||||
$var->{javascript} = "<script type='text/javascript'>\n".
|
||||
"var maxComparisons = ".$maxComparisons.";\n".
|
||||
"var matrixUrl = '".$self->getUrl."';\n".
|
||||
"</script>";
|
||||
|
||||
if ($self->canEdit){
|
||||
# Get all the MatrixListings that are still pending.
|
||||
|
|
@ -858,6 +889,9 @@ sub www_compare {
|
|||
if($self->session->user->isVisitor){
|
||||
$maxComparisons = $self->get('maxComparisons');
|
||||
}
|
||||
elsif($self->session->user->isInGroup( $self->get("maxComparisonsGroup") )) {
|
||||
$maxComparisons = $self->get('maxComparisonsGroupInt');
|
||||
}
|
||||
else{
|
||||
$maxComparisons = $self->get('maxComparisonsPrivileged');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -427,6 +427,16 @@ listing,|,
|
|||
lastUpdated => 1135271460,
|
||||
},
|
||||
|
||||
'maxgroup per description' => {
|
||||
message => q|Specifies how many comparisons are allowed for the privileged group.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'maxgroup description' => {
|
||||
message => q|Select a group for which a specific maximum comparisons can be selected.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'max comparisons description' => {
|
||||
message => q|Specifies how many comparisons are allowed in searches and comparisons.|,
|
||||
lastUpdated => 0,
|
||||
|
|
@ -602,6 +612,16 @@ to increase performance. How long should we cache them?|,
|
|||
message => q|Compare Color: Yes|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'maxgroup per label' => {
|
||||
message => q|Maximum for Privileged Group|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'maxgroup label' => {
|
||||
message => q|Privileged Maximum Group|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'max comparisons label' => {
|
||||
message => q|Maximum Comparisons|,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue