[Rt-commit] rt branch, 4.4/auto-create-missing-queue-custom-roles, created. rt-4.4.3-94-g671902086

? sunnavy sunnavy at bestpractical.com
Thu Dec 13 16:52:11 EST 2018


The branch, 4.4/auto-create-missing-queue-custom-roles has been created
        at  67190208666ffea58d35e68989413c942dcc6d00 (commit)

- Log -----------------------------------------------------------------
commit 67190208666ffea58d35e68989413c942dcc6d00
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Dec 14 05:26:59 2018 +0800

    Allow to create missing queue-level custom role groups when needed
    
    Since ticket level custom role groups could be automatically created,
    queue level ones should have the same behavior, not mentioning the
    behavior is also consistent with default role groups.

diff --git a/lib/RT/CustomRole.pm b/lib/RT/CustomRole.pm
index 8c9b08451..9dc6d6f46 100644
--- a/lib/RT/CustomRole.pm
+++ b/lib/RT/CustomRole.pm
@@ -172,9 +172,9 @@ sub _RegisterAsRole {
             $role->Load($id);
 
             if ($object->isa('RT::Queue')) {
-                # there's no way to apply the custom
-                # role to a queue before that queue is created
-                return 0;
+                # In case queue level custom role groups got deleted
+                # somehow.  Allow to re-create them like default ones.
+                return $role->IsAdded($object->id);
             }
             elsif ($object->isa('RT::Ticket')) {
                 # see if the role has been applied to the ticket's queue

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


More information about the rt-commit mailing list