import rt 3.0.12
[freeside.git] / rt / html / Admin / Groups / GroupRights.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 group rights for group [_1]', $GroupObj->Name) &>
25 <& /Admin/Elements/GroupTabs, 
26     GroupObj => $GroupObj, 
27     current_tab => 'Admin/Groups/GroupRights.html?id='.$id, 
28     Title => loc('Modify group rights for group [_1]', $GroupObj->Name) &>
29 <& /Elements/ListActions, actions => \@results &>
30
31   <FORM METHOD=POST ACTION="GroupRights.html">
32     <INPUT TYPE=HIDDEN NAME=id VALUE="<% $GroupObj->id %>">
33       
34 <& /Elements/TitleBoxStart, title => loc('Modify group rights for group [_1]', $GroupObj->Name) &>
35       
36 <h1><&|/l&>System groups</&></h1>
37 <TABLE>
38 % $Groups = RT::Groups->new($session{'CurrentUser'});
39 % $Groups->LimitToSystemInternalGroups();
40 %       while (my $Group = $Groups->Next()) {
41   <TR ALIGN=RIGHT> 
42         <TD VALIGN=TOP>
43             <% loc($Group->Type) %>
44                   </TD>
45           <TD>
46             <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId,
47         PrincipalType => 'Group',
48         Object => $GroupObj  &>
49           </TD>
50         </TR>
51 % }
52 </TABLE>
53 <h1><&|/l&>User defined groups</&></h1>
54 <TABLE>
55 % $Groups = RT::Groups->new($session{'CurrentUser'});
56 % $Groups->LimitToUserDefinedGroups();    
57 %       while (my $Group = $Groups->Next()) {
58   <TR ALIGN=RIGHT> 
59         <TD VALIGN=TOP>
60             <% $Group->Name %>
61                   </TD>
62           <TD>
63             <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId,
64         PrincipalType => 'Group',
65         Object => $GroupObj  &>
66           </TD>
67         </TR>
68 % }
69 </TABLE>
70             
71       <& /Elements/TitleBoxEnd &>
72       <& /Elements/Submit, Label => loc('Modify Group Rights'), Reset => 1 &>
73       
74   </FORM>
75   
76 <%INIT>
77  
78   #Update the acls.
79   my @results =  ProcessACLChanges(\%ARGS);
80
81
82 if (!defined $id) {
83     Abort(loc("No Group defined"));
84 }
85
86 my $GroupObj = RT::Group->new($session{'CurrentUser'});
87 $GroupObj->Load($id) || Abort(loc("Couldn't load group [_1]",$id));
88
89 my $Groups;
90     
91 </%INIT>
92
93 <%ARGS>
94 $id => undef
95 </%ARGS>