[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-418-g772a66f

Shawn Moore sartak at bestpractical.com
Mon Aug 16 21:56:37 EDT 2010


The branch, 3.9-trunk has been updated
       via  772a66f518414c62329256dc7e33578eacb39815 (commit)
      from  1efe5efa84a7ec07ec8c8c6e91c41297612834e7 (commit)

Summary of changes:
 lib/RT/Group_Overlay.pm |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 772a66f518414c62329256dc7e33578eacb39815
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Aug 16 21:58:51 2010 -0400

    Factor out role group type check into a method

diff --git a/lib/RT/Group_Overlay.pm b/lib/RT/Group_Overlay.pm
index 169935f..d424102 100755
--- a/lib/RT/Group_Overlay.pm
+++ b/lib/RT/Group_Overlay.pm
@@ -616,13 +616,21 @@ Returns a tuple of (Id, Message).  If id is 0, the create failed
 
 =cut
 
+sub _ValidRoleGroupType {
+    my $self = shift;
+    my $type = shift;
+
+    return $type =~ /^(?:Cc|AdminCc|Requestor|Owner)$/;
+}
+
 sub CreateRoleGroup {
     my $self = shift;
     my %args = ( Instance => undef,
                  Type     => undef,
                  Domain   => undef,
                  @_ );
-    unless ( $args{'Type'} =~ /^(?:Cc|AdminCc|Requestor|Owner)$/ ) {
+
+    unless ($self->_ValidRoleGroupType($args{Type})) {
         return ( 0, $self->loc("Invalid Group Type") );
     }
 

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


More information about the Rt-commit mailing list