[Rt-commit] rt branch, 4.4/multiple-asset-owners, created. rt-4.4.1-2-ga3d5e59
Shawn Moore
shawn at bestpractical.com
Thu Apr 20 14:46:43 EDT 2017
The branch, 4.4/multiple-asset-owners has been created
at a3d5e590350f162b82a9d7eb634cee593b6911ae (commit)
- Log -----------------------------------------------------------------
commit 0effaeb56be17127e9a50ba05ec84cbd77668250
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Thu Apr 20 18:41:35 2017 +0000
Add setting $AssetMultipleOwner to allow many owners on assets
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 7722558..5a4f833 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1822,6 +1822,17 @@ Set( $AssetBasicCustomFieldsOnCreate, [ 'foo', 'bar' ] );
=back
+=item C<$AssetMultipleOwner>
+
+By default an asset is limited to a single user as an owner. By setting
+this to a true value, you can allow multiple users and groups as owner.
+If you change this back to a false value while having multiple owners
+set on any assets, RT's behavior may be inconsistent.
+
+=cut
+
+Set($AssetMultipleOwner, 0);
+
=head2 Message box properties
=over 4
diff --git a/lib/RT/Asset.pm b/lib/RT/Asset.pm
index b2e75bb..4e89b0f 100644
--- a/lib/RT/Asset.pm
+++ b/lib/RT/Asset.pm
@@ -83,6 +83,8 @@ RT::CustomField->RegisterBuiltInGroupings(
'RT::Asset' => [qw( Basics Dates People Links )]
);
+my $multiple_owner = RT->Config->Get('AssetMultipleOwner');
+
# loc('Owner')
# loc('HeldBy')
# loc('Contact')
@@ -93,7 +95,7 @@ for my $role ('Owner', 'HeldBy', 'Contact') {
EquivClasses => ["RT::Catalog"],
SortOrder => $i++,
( $role eq "Owner"
- ? ( Single => 1,
+ ? ( Single => ($multiple_owner ? 0 : 1),
ACLOnlyInEquiv => 1, )
: () ),
);
commit a3d5e590350f162b82a9d7eb634cee593b6911ae
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Thu Apr 20 18:43:41 2017 +0000
Don't show Nobody in multi-user roles on assets
If you turn on $AssetMultipleOwner after having created catalogs and
assets, then because those single-user role groups had been populated
with the Nobody user, we may display Nobody as an owner, even alongside
other real users.
diff --git a/share/html/Asset/Elements/ShowRoleMembers b/share/html/Asset/Elements/ShowRoleMembers
index 1cb1421..36964c3 100644
--- a/share/html/Asset/Elements/ShowRoleMembers
+++ b/share/html/Asset/Elements/ShowRoleMembers
@@ -53,6 +53,7 @@
<h3><& /Elements/ShowUser, User => $user, Link => 1 &></h3>
% next if $user->id == RT->Nobody->id;
% } else {
+% next if $user->id == RT->Nobody->id;
<h3><a href="#"><& /Elements/ShowUser, User => $user, Link => 0 &>
% if ($Note) {
<span class="note"><% $Note %></span>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list