X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fdocs%2Fdesign_docs%2Facls;fp=rt%2Fdocs%2Fdesign_docs%2Facls;h=0000000000000000000000000000000000000000;hp=bb093adcbba8a392a2254accc32247bc88e120e9;hb=43a06151e47d2c59b833cbd8c26d97865ee850b6;hpb=6587f6ba7d047ddc1686c080090afe7d53365bd4 diff --git a/rt/docs/design_docs/acls b/rt/docs/design_docs/acls deleted file mode 100644 index bb093adcb..000000000 --- a/rt/docs/design_docs/acls +++ /dev/null @@ -1,50 +0,0 @@ - - -Does principal baz have right foo for object bar - -What rights does user baz have for object bar - -# {{{ Which principals have right foo for object bar - - -if ($args{'ObjectType'} eq 'Ticket') { - $or_check_ticket_roles = " OR ( Groups.Domain = 'TicketRole' AND Groups.Instance = '".$args{'ObjectId'}."') "; - # If we're looking at ticket rights, we also want to look at the associated queue rights. - # this is a little bit hacky, but basically, now that we've done the ticket roles magic, we load the queue object - # and ask all the rest of our questions about the queue. - my $tick = RT::Ticket->new($RT::SystemUser); - $tick->Load($args{'ObjectId'}); - $args{'ObjectType'} = 'Queue'; - $args{'ObjectId'} = $tick->QueueObj->Id(); - -} -if ($args{'ObjectType'} eq 'Queue') { - $or_check_roles = " OR ( ( (Groups.Domain = 'QueueRole' AND Groups.Instance = '".$args{'ObjectId'}."') $or_check_ticket_roles ) - AND Groups.Type = ACL.PrincipalType AND Groups.Id = Principals.ObjectId AND Principals.PrincipalType = 'Group') "; -} - -if (defined $args{'ObjectType'} ) { - $or_look_at_object_rights = " OR (ACL.ObjectType = '".$args{'ObjectType'}."' AND ACL.ObjectId = '".$args{'ObjectId'}."') "; - -} - -my $query = "SELECT Users.* from ACL, Groups, Users, Principals, Principals UserPrinc, CachedGroupMembers WHERE - Users.id = UserPrinc.ObjectId AND UserPrinc.PrincipalType = 'User' AND - Principals.Id = CachedGroupMembers.GroupId AND - CachedGroupMembers.MemberId = UserPrinc.ObjectId AND - UserPrinc.PrincipalType = 'User' AND - (ACL.RightName = 'SuperUser' OR ACL.RightName = '$right') AND - (ACL.ObjectType = 'System' $or_look_at_object_rights) AND - ( - (ACL.PrincipalId = Principals.Id AND - Principals.ObjectId = Groups.Id AND - ACL.PrincipalType = 'Group' AND - (Groups.Domain = 'SystemInternal' OR Groups.Domain = 'UserDefined' OR Groups.Domain = 'ACLEquivalence') - ) - $or_check_roles - )"; - -# }}} - -What objects does principal baz have right foo for -;