[Rt-commit] r19004 - in rt/3.999/trunk/lib/RT: .
ruz at bestpractical.com
ruz at bestpractical.com
Tue Mar 31 14:32:03 EDT 2009
Author: ruz
Date: Tue Mar 31 14:32:02 2009
New Revision: 19004
Modified:
rt/3.999/trunk/lib/RT/IsPrincipal.pm
rt/3.999/trunk/lib/RT/Model/ACE.pm
rt/3.999/trunk/lib/RT/Model/Group.pm
Log:
* type_for_acl in IsPrincipal
Modified: rt/3.999/trunk/lib/RT/IsPrincipal.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/IsPrincipal.pm (original)
+++ rt/3.999/trunk/lib/RT/IsPrincipal.pm Tue Mar 31 14:32:02 2009
@@ -40,6 +40,14 @@
return $res;
}
+=head2 type_for_acl
+
+Returns type for ACL records. For now only roles has type.
+
+=cut
+
+sub type_for_acl { return undef }
+
=head2 principal
Returns L<RT::Model::Principal/|"the principal object"> for this record.
Modified: rt/3.999/trunk/lib/RT/Model/ACE.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/ACE.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/ACE.pm Tue Mar 31 14:32:02 2009
@@ -81,7 +81,6 @@
column type =>
max_length is 25,
type is 'varchar(25)',
- default is ''
;
column principal => references RT::Model::Principal;
column right_name => max_length is 25, type is 'varchar(25)', is mandatory;
@@ -228,6 +227,8 @@
return ( 0, $msg );
}
+ $args{'type'} ||= $acl_group->type_for_acl;
+
# {{{ Check the ACL
if ( $args{'object'}->isa('RT::Model::Group') ) {
Modified: rt/3.999/trunk/lib/RT/Model/Group.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Group.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/Group.pm Tue Mar 31 14:32:02 2009
@@ -675,6 +675,13 @@
sub acl_equivalence_group { return $_[0] }
+sub type_for_acl {
+ my $self = shift;
+ return undef unless $self->domain =~ /Role$/;
+ return $self->type;
+}
+
+
sub basic_columns {
( [ name => 'name' ], [ description => 'description' ], );
}
More information about the Rt-commit
mailing list