[Bps-public-commit] rt-extension-assets branch, 1.0-trunk, updated. d9703c7a146edaa8fda512d0a03c10623a09aa1b

Alex Vandiver alexmv at bestpractical.com
Tue Jan 28 18:34:04 EST 2014


The branch, 1.0-trunk has been updated
       via  d9703c7a146edaa8fda512d0a03c10623a09aa1b (commit)
      from  1f36a95aaaa1076945d2bdb6114d6ba478776812 (commit)

Summary of changes:
 lib/RT/Asset.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit d9703c7a146edaa8fda512d0a03c10623a09aa1b
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Jan 28 18:33:56 2014 -0500

    Role resolution errors (aka "user does not exist") should be fatal

diff --git a/lib/RT/Asset.pm b/lib/RT/Asset.pm
index 4ee46d6..b4c0e23 100644
--- a/lib/RT/Asset.pm
+++ b/lib/RT/Asset.pm
@@ -249,6 +249,10 @@ sub Create {
         );
     }
 
+    my $roles = {};
+    my @errors = $self->_ResolveRoles( $roles, %args );
+    return (0, @errors) if @errors;
+
     RT->DatabaseHandle->BeginTransaction();
 
     my ( $id, $msg ) = $self->SUPER::Create(
@@ -271,8 +275,6 @@ sub Create {
     }
 
     # Figure out users for roles
-    my $roles = {};
-    push @non_fatal_errors, $self->_ResolveRoles( $roles, %args );
     push @non_fatal_errors, $self->_AddRolesOnCreate( $roles, map { $_ => sub {1} } $self->Roles );
 
     # Add CFs

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list