[Bps-public-commit] rt-extension-assets branch, 1.0/selfservice-links, updated. 1.0rc1-4-g11b7be0
Alex Vandiver
alexmv at bestpractical.com
Wed Feb 19 13:37:48 EST 2014
The branch, 1.0/selfservice-links has been updated
via 11b7be04f3d7472c9ea8604d36aff09783bba085 (commit)
via 238ed48e57bbf4a24c5a3e7a4500be9947c9e46e (commit)
from 1b43ad368cf7e17b0aa0107f5812dd6eedb436df (commit)
Summary of changes:
html/Asset/Elements/ShowSummary | 16 +++++++++-------
html/Ticket/Elements/ShowAssets | 2 ++
2 files changed, 11 insertions(+), 7 deletions(-)
- Log -----------------------------------------------------------------
commit 238ed48e57bbf4a24c5a3e7a4500be9947c9e46e
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Feb 19 13:32:18 2014 -0500
Hide "Add an asset" box unless the user has ModifyTicket
diff --git a/html/Ticket/Elements/ShowAssets b/html/Ticket/Elements/ShowAssets
index 27a00d5..ac32c66 100644
--- a/html/Ticket/Elements/ShowAssets
+++ b/html/Ticket/Elements/ShowAssets
@@ -187,6 +187,7 @@ if ($ShowRelatedTickets) {
% }
</div>
+% if ($Ticket->CurrentUserHasRight("ModifyTicket")) {
<div class="add-asset">
<label>
<&|/l&>Add an asset to this ticket</&>
@@ -194,6 +195,7 @@ if ($ShowRelatedTickets) {
</label>
<input type="submit" value="+">
</div>
+% }
% $m->callback( CallbackName => "End", Ticket => $Ticket, Assets => $assets );
commit 11b7be04f3d7472c9ea8604d36aff09783bba085
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Feb 19 13:37:32 2014 -0500
Don't link to asset Modify pages if the user only has SelfService
diff --git a/html/Asset/Elements/ShowSummary b/html/Asset/Elements/ShowSummary
index be39e65..d16c3aa 100644
--- a/html/Asset/Elements/ShowSummary
+++ b/html/Asset/Elements/ShowSummary
@@ -57,12 +57,14 @@ my @sections = (
);
my %link;
-for my $section (@sections) {
- my $page = $section eq 'Basics' ? "Modify.html" : "Modify$section.html";
- $link{$section} =
- RT->Config->Get("WebPath")
- . "/Asset/$page?id="
- . $AssetObj->id;
+if ($session{CurrentUser}->Privileged) {
+ for my $section (@sections) {
+ my $page = $section eq 'Basics' ? "Modify.html" : "Modify$section.html";
+ $link{$section} =
+ RT->Config->Get("WebPath")
+ . "/Asset/$page?id="
+ . $AssetObj->id;
+ }
}
</%init>
<div class="asset-metadata">
@@ -74,7 +76,7 @@ for my $section (@sections) {
<& /Elements/ShowCustomFieldCustomGroupings,
Object => $AssetObj,
- title_href => RT->Config->Get("WebPath") . "/Asset/ModifyCFs.html",
+ title_href => $session{CurrentUser}->Privileged ? RT->Config->Get("WebPath") . "/Asset/ModifyCFs.html" : "",
TitleBoxARGS => { title_class => "inverse" },
&>
</div>
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list