import of rt 3.0.4
[freeside.git] / rt / html / Admin / Queues / UserRights.html
1 %# BEGIN LICENSE BLOCK
2 %# 
3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4 %# 
5 %# (Except where explictly superceded by other copyright notices)
6 %# 
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
10 %# from www.gnu.org.
11 %# 
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 %# General Public License for more details.
16 %# 
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
21 %# 
22 %# 
23 %# END LICENSE BLOCK
24 <& /Admin/Elements/Header, Title => loc('Modify user rights for queue [_1]', $QueueObj->Name) &>
25 <& /Admin/Elements/QueueTabs, id => $id,
26     QueueObj => $QueueObj,                                                      
27     current_tab => $current_tab, 
28     Title => loc('Modify user rights for queue [_1]', $QueueObj->Name) &>
29 <& /Elements/ListActions, actions => \@results &>
30
31   <FORM METHOD=POST ACTION="UserRights.html">
32     <INPUT TYPE=HIDDEN NAME=id VALUE="<% $QueueObj->id %>">
33       
34       
35 <TABLE>
36 <& /Elements/Callback, QueueObj => $QueueObj, results => \@results, %ARGS &>
37 %       while (my $Member = $Users->Next()) {
38 % my $UserObj = $Member->MemberObj->Object();
39 % my $group = RT::Group->new($session{'CurrentUser'});
40 % $group->LoadACLEquivalenceGroup($Member->MemberObj);
41   <TR ALIGN=RIGHT> 
42         <TD VALIGN=TOP>
43             <% $UserObj->Name %>
44                   </TD>
45           <TD>
46             <& /Admin/Elements/SelectRights, PrincipalId=> $group->PrincipalId,
47         Object => $QueueObj  &>
48           </TD>
49         </TR>
50 % }
51       </TABLE>
52             
53       <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &>
54       
55   </FORM>
56   
57 <%INIT>
58  
59   #Update the acls.
60   my @results =  ProcessACLChanges(\%ARGS);
61
62 # {{{ Deal with setting up the display of current rights.
63
64
65
66 if (!defined $id) {
67     Abort(loc("No Queue defined"));
68 }
69
70 my $QueueObj = RT::Queue->new($session{'CurrentUser'});
71 $QueueObj->Load($id) || Abort(loc("Couldn't load queue [_1]",$id));
72
73 # Find out which users we want to display ACL selects for
74 my $Privileged = RT::Group->new($session{'CurrentUser'});
75 $Privileged->LoadSystemInternalGroup('Privileged');
76 my $Users = $Privileged->MembersObj();
77
78     
79   
80 # }}}
81 my $current_tab;
82 $current_tab = 'Admin/Queues/UserRights.html?id='.$QueueObj->id;
83 </%INIT>
84
85 <%ARGS>
86 $id => undef
87 $UserString => undef
88 $UserOp => undef
89 $UserField => undef
90 </%ARGS>