[Rt-commit] rtir branch, 5.0/abort-ticket-create-page-if-no-queue, created. 5.0.0beta1-4-g3e4066c1

Craig Kaiser craig at bestpractical.com
Wed Jul 8 17:59:48 EDT 2020


The branch, 5.0/abort-ticket-create-page-if-no-queue has been created
        at  3e4066c1a340495ef76fd4c97c38f38432fb5ba1 (commit)

- Log -----------------------------------------------------------------
commit dd32879ead002d9979710fc2793a53182d48ee81
Author: craig kaiser <craig at bestpractical.com>
Date:   Wed Jul 1 14:19:30 2020 -0400

    Don't load first queue in queues cache on RTIR create page
    
    If no RTIR queue could be loaded prior then it is likely that the
    current user does not have rights to view the RTIR queues or they do not
    exist. That means grabbing the first queue in the queue cache will
    return an RT queue not an RTIR queue.

diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index 6c9c7615..4b4c4e93 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -421,18 +421,6 @@ unless ($Queue) {
     }
 }
 
-# pick first in list in normal order unless queue provided from form/url/defaults
-unless ($Queue) {
-    my $cache_key = SetObjectSessionCache(
-        ObjectType       => 'Queue',
-        CheckRight       => 'CreateTicket',
-        ShowAll          => 0,
-        CacheNeedsUpdate => RT->System->QueueCacheNeedsUpdate,
-    );
-
-    $Queue = $session{$cache_key}{objects}[0]->{Id};
-}
-
 my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
 $QueueObj->Load( $Queue );
 

commit 3e4066c1a340495ef76fd4c97c38f38432fb5ba1
Author: craig kaiser <craig at bestpractical.com>
Date:   Wed Jul 8 17:45:49 2020 -0400

    Abort on RTIR ticket create if no queue arg can be found

diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index 4b4c4e93..27e4a8bc 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -382,6 +382,8 @@
 </form>
 
 <%INIT>
+Abort( loc( "Permission Denied" ) ) unless $Queue;
+
 # Make sure even a single checkbox value becomes an arrayref
 $ARGS{'SkipNotification'} = \@SkipNotification;
 
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 3566ecb5..f9de375c 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -411,6 +411,7 @@ unless ( $queue ) {
         last;
     }
 }
+Abort( loc( "Permission Denied" ) ) unless $queue;
 
 my $QueueObj = RT::Queue->new($session{'CurrentUser'});
 $QueueObj->Load( $queue );

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


More information about the rt-commit mailing list