[Rt-commit] r10567 - in rt/branches/3.999-DANGEROUS/lib/RT: Model
ruz at bestpractical.com
ruz at bestpractical.com
Tue Jan 29 18:37:09 EST 2008
Author: ruz
Date: Tue Jan 29 18:37:08 2008
New Revision: 10567
Modified:
rt/branches/3.999-DANGEROUS/lib/RT/Model/ACECollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/Principal.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/TicketCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/UserCollection.pm
rt/branches/3.999-DANGEROUS/lib/RT/System.pm
Log:
* GroupId/MemberId fixes
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/ACECollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/ACECollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/ACECollection.pm Tue Jan 29 18:37:08 2008
@@ -177,11 +177,11 @@
alias1 => 'main',
column1 => 'principal_id',
alias2 => $cgm,
- column2 => 'GroupId'
+ column2 => 'group_id'
);
$self->limit(
alias => $cgm,
- column => 'MemberId',
+ column => 'member_id',
operator => '=',
value => $args{'id'},
entry_aggregator => 'OR'
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm Tue Jan 29 18:37:08 2008
@@ -77,9 +77,9 @@
return ($RIGHTS);
}
-# {{{ sub SelfDescription
+# {{{ sub self_description
-=head2 SelfDescription
+=head2 self_description
Returns a user-readable description of what this group is for and what it's named.
@@ -731,9 +731,9 @@
# }}}
-# {{{ MembersObj
+# {{{ members_obj
-=head2 MembersObj
+=head2 members_obj
Returns an RT::Model::GroupMemberCollection object of this group's direct members.
@@ -1027,8 +1027,8 @@
my $member_obj = RT::Model::GroupMember->new;
$member_obj->load_by_cols(
- MemberId => $id,
- GroupId => $self->id
+ member_id => $id,
+ group_id => $self->id
);
if ( my $member_id = $member_obj->id ) {
@@ -1071,8 +1071,8 @@
my $member_obj = RT::Model::CachedGroupMember->new;
$member_obj->load_by_cols(
- MemberId => $id,
- GroupId => $self->id
+ member_id => $id,
+ group_id => $self->id
);
if ( my $member_id = $member_obj->id ) {
@@ -1145,8 +1145,8 @@
my $member_obj = RT::Model::GroupMember->new;
$member_obj->load_by_cols(
- MemberId => $member_id,
- GroupId => $self->id
+ member_id => $member_id,
+ group_id => $self->id
);
#If we couldn't load it, return undef.
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Principal.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Principal.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Principal.pm Tue Jan 29 18:37:08 2008
@@ -434,9 +434,9 @@
# never find recursively disabled group members
# also, check to see if the right is being granted _directly_ to this principal,
# as is the case when we want to look up group rights
- . "AND CachedGroupMembers.GroupId = ACL.principal_id "
- . "AND CachedGroupMembers.GroupId = Principals.id "
- . "AND CachedGroupMembers.MemberId = "
+ . "AND CachedGroupMembers.group_id = ACL.principal_id "
+ . "AND CachedGroupMembers.group_id = Principals.id "
+ . "AND CachedGroupMembers.member_id = "
. $self->id . " "
. "AND CachedGroupMembers.disabled = 0 ";
my @clauses;
@@ -490,8 +490,8 @@
# never find recursively disabled group members
# also, check to see if the right is being granted _directly_ to this principal,
# as is the case when we want to look up group rights
- . "AND Principals.id = CachedGroupMembers.GroupId "
- . "AND CachedGroupMembers.MemberId = "
+ . "AND Principals.id = CachedGroupMembers.group_id "
+ . "AND CachedGroupMembers.member_id = "
. $self->id . " "
. "AND ACL.principal_type = Groups.type ";
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/TicketCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/TicketCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/TicketCollection.pm Tue Jan 29 18:37:08 2008
@@ -820,7 +820,7 @@
leftjoin => $group_members,
column => 'group_id',
operator => '!=',
- value => "$group_members.MemberId",
+ value => "$group_members.member_id",
quote_value => 0,
);
$self->_sql_limit(
@@ -872,7 +872,7 @@
leftjoin => $group_members,
column => 'group_id',
operator => '!=',
- value => "$group_members.MemberId",
+ value => "$group_members.member_id",
quote_value => 0,
);
my $users = $self->join(
@@ -1024,12 +1024,12 @@
# table and break ordering. Now, we know that
# RT doesn't allow to add groups as members of the
# ticket roles, so we just hide entries in CGM table
- # with MemberId == GroupId from results
+ # with member_id == group_id from results
$self->SUPER::limit(
leftjoin => $group_members,
column => 'group_id',
operator => '!=',
- value => "$group_members.MemberId",
+ value => "$group_members.member_id",
quote_value => 0,
);
my $users = $self->join(
@@ -1073,9 +1073,9 @@
) AND
Groups_1.instance = main.id
AND
- Groups_1.id = CachedGroupMembers_2.GroupId
+ Groups_1.id = CachedGroupMembers_2.group_id
AND
- CachedGroupMembers_2.MemberId = Users_3.id
+ CachedGroupMembers_2.member_id = Users_3.id
order BY main.id ASC
LIMIT 25
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/UserCollection.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/UserCollection.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/UserCollection.pm Tue Jan 29 18:37:08 2008
@@ -469,7 +469,7 @@
$self->limit(
alias => $args{'ACLAlias'},
column => 'principal_id',
- value => "$group_members.GroupId",
+ value => "$group_members.group_id",
quote_value => 0,
);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/System.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/System.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/System.pm Tue Jan 29 18:37:08 2008
@@ -52,7 +52,7 @@
$RT::Model::ACE::LOWERCASERIGHTNAMES{ lc $right } = $right;
}
-=head2 AvailableRights
+=head2 available_rights
Returns a hash of available rights for this object.
The keys are the right names and the values are a
More information about the Rt-commit
mailing list