615 |
18 May 05 |
nicklas |
1 |
<%-- $Id$ |
615 |
18 May 05 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2005 Nicklas Nordborg |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
615 |
18 May 05 |
nicklas |
5 |
|
2304 |
22 May 06 |
jari |
6 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
7 |
Available at http://base.thep.lu.se/ |
615 |
18 May 05 |
nicklas |
8 |
|
615 |
18 May 05 |
nicklas |
9 |
BASE is free software; you can redistribute it and/or |
615 |
18 May 05 |
nicklas |
10 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
11 |
as published by the Free Software Foundation; either version 3 |
615 |
18 May 05 |
nicklas |
12 |
of the License, or (at your option) any later version. |
615 |
18 May 05 |
nicklas |
13 |
|
615 |
18 May 05 |
nicklas |
14 |
BASE is distributed in the hope that it will be useful, |
615 |
18 May 05 |
nicklas |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
615 |
18 May 05 |
nicklas |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
615 |
18 May 05 |
nicklas |
17 |
GNU General Public License for more details. |
615 |
18 May 05 |
nicklas |
18 |
|
615 |
18 May 05 |
nicklas |
19 |
You should have received a copy of the GNU General Public License |
4510 |
11 Sep 08 |
jari |
20 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
615 |
18 May 05 |
nicklas |
21 |
------------------------------------------------------------------ |
615 |
18 May 05 |
nicklas |
22 |
|
615 |
18 May 05 |
nicklas |
23 |
Configure the order and visibility of columns in a table of items. |
615 |
18 May 05 |
nicklas |
24 |
This page will use the TableColumn.getTableColumns(item) to retreive the |
615 |
18 May 05 |
nicklas |
25 |
list of all available columns for that item type and |
615 |
18 May 05 |
nicklas |
26 |
getSession().getSetting(item+".columns") to retreive a comma-separated |
615 |
18 May 05 |
nicklas |
27 |
list of the current order of visible columns. |
615 |
18 May 05 |
nicklas |
28 |
|
615 |
18 May 05 |
nicklas |
29 |
@param item The type of items in the table |
615 |
18 May 05 |
nicklas |
30 |
|
615 |
18 May 05 |
nicklas |
31 |
@author Nicklas |
615 |
18 May 05 |
nicklas |
32 |
@version 2.0 |
615 |
18 May 05 |
nicklas |
33 |
--%> |
5426 |
24 Sep 10 |
nicklas |
34 |
<%@ page pageEncoding="UTF-8" session="false" |
615 |
18 May 05 |
nicklas |
35 |
import="net.sf.basedb.core.SessionControl" |
620 |
19 May 05 |
nicklas |
36 |
import="net.sf.basedb.core.DbControl" |
615 |
18 May 05 |
nicklas |
37 |
import="net.sf.basedb.core.SystemItems" |
620 |
19 May 05 |
nicklas |
38 |
import="net.sf.basedb.core.Item" |
620 |
19 May 05 |
nicklas |
39 |
import="net.sf.basedb.core.ItemKey" |
2196 |
27 Apr 06 |
martin |
40 |
import="net.sf.basedb.core.Nameable" |
2196 |
27 Apr 06 |
martin |
41 |
import="net.sf.basedb.core.SharedItem" |
620 |
19 May 05 |
nicklas |
42 |
import="net.sf.basedb.core.ProjectKey" |
615 |
18 May 05 |
nicklas |
43 |
import="net.sf.basedb.core.Permission" |
620 |
19 May 05 |
nicklas |
44 |
import="net.sf.basedb.core.MultiPermissions" |
620 |
19 May 05 |
nicklas |
45 |
import="net.sf.basedb.core.User" |
615 |
18 May 05 |
nicklas |
46 |
import="net.sf.basedb.core.Group" |
620 |
19 May 05 |
nicklas |
47 |
import="net.sf.basedb.core.Project" |
1418 |
07 Oct 05 |
nicklas |
48 |
import="net.sf.basedb.core.ItemQuery" |
1418 |
07 Oct 05 |
nicklas |
49 |
import="net.sf.basedb.core.ItemResultIterator" |
620 |
19 May 05 |
nicklas |
50 |
import="net.sf.basedb.core.query.Orders" |
1418 |
07 Oct 05 |
nicklas |
51 |
import="net.sf.basedb.core.query.Hql" |
615 |
18 May 05 |
nicklas |
52 |
import="net.sf.basedb.clients.web.Base" |
1965 |
10 Feb 06 |
nicklas |
53 |
import="net.sf.basedb.clients.web.PermissionUtil" |
1713 |
14 Dec 05 |
nicklas |
54 |
import="net.sf.basedb.clients.web.WebException" |
620 |
19 May 05 |
nicklas |
55 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
56 |
import="net.sf.basedb.util.Values" |
6322 |
11 Sep 13 |
nicklas |
57 |
import="net.sf.basedb.util.json.JsonUtil" |
6322 |
11 Sep 13 |
nicklas |
58 |
import="net.sf.basedb.util.json.NameableConverter" |
6322 |
11 Sep 13 |
nicklas |
59 |
import="org.json.simple.JSONObject" |
6322 |
11 Sep 13 |
nicklas |
60 |
import="org.json.simple.JSONArray" |
615 |
18 May 05 |
nicklas |
61 |
import="java.util.EnumSet" |
615 |
18 May 05 |
nicklas |
62 |
import="java.util.Set" |
620 |
19 May 05 |
nicklas |
63 |
import="java.util.Map" |
615 |
18 May 05 |
nicklas |
64 |
%> |
615 |
18 May 05 |
nicklas |
65 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
615 |
18 May 05 |
nicklas |
66 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
615 |
18 May 05 |
nicklas |
67 |
<%! |
1965 |
10 Feb 06 |
nicklas |
68 |
private static final int READ_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.READ)); |
1965 |
10 Feb 06 |
nicklas |
69 |
private static final int USE_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.USE)); |
7212 |
19 Oct 16 |
nicklas |
70 |
private static final int RESTRICTED_WRITE_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.RESTRICTED_WRITE)); |
1965 |
10 Feb 06 |
nicklas |
71 |
private static final int WRITE_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.WRITE)); |
1965 |
10 Feb 06 |
nicklas |
72 |
private static final int DELETE_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.DELETE)); |
1965 |
10 Feb 06 |
nicklas |
73 |
private static final int SET_OWNER_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.SET_OWNER)); |
1965 |
10 Feb 06 |
nicklas |
74 |
private static final int SET_PERMISSION_CODE = PermissionUtil.getPermissionCode(EnumSet.of(Permission.SET_PERMISSION)); |
615 |
18 May 05 |
nicklas |
75 |
%> |
615 |
18 May 05 |
nicklas |
76 |
<% |
615 |
18 May 05 |
nicklas |
77 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
615 |
18 May 05 |
nicklas |
78 |
final String ID = sc.getId(); |
620 |
19 May 05 |
nicklas |
79 |
final Item itemType = Item.valueOf(request.getParameter("item_type")); |
2218 |
05 May 06 |
nicklas |
80 |
final String subContext = Values.getString(request.getParameter("subcontext"), ""); |
615 |
18 May 05 |
nicklas |
81 |
|
7954 |
12 May 21 |
nicklas |
82 |
final DbControl dc = sc.newDbControl(":Share items"); |
1418 |
07 Oct 05 |
nicklas |
83 |
ItemResultIterator<User> users = null; |
1418 |
07 Oct 05 |
nicklas |
84 |
ItemResultIterator<Group> groups = null; |
1418 |
07 Oct 05 |
nicklas |
85 |
ItemResultIterator<Project> projects = null; |
620 |
19 May 05 |
nicklas |
86 |
try |
620 |
19 May 05 |
nicklas |
87 |
{ |
7605 |
26 Feb 19 |
nicklas |
88 |
final MultiPermissions mp = sc.getCurrentContext(itemType, subContext).getObject("MultiPermissions"); |
1713 |
14 Dec 05 |
nicklas |
89 |
if (mp == null) |
1713 |
14 Dec 05 |
nicklas |
90 |
{ |
1713 |
14 Dec 05 |
nicklas |
91 |
throw new WebException("popup", "Item not found", "No MultiPermissions object found for item: " + itemType); |
1713 |
14 Dec 05 |
nicklas |
92 |
} |
615 |
18 May 05 |
nicklas |
93 |
|
7212 |
19 Oct 16 |
nicklas |
94 |
final boolean hasAnnotatableItem = mp.hasAnnotatableItem(); |
6322 |
11 Sep 13 |
nicklas |
95 |
JSONArray jsonShare = new JSONArray(); |
6322 |
11 Sep 13 |
nicklas |
96 |
|
620 |
19 May 05 |
nicklas |
97 |
// Query to retrieve users |
1418 |
07 Oct 05 |
nicklas |
98 |
final ItemQuery<User> userQuery = mp.getUsers(); |
1418 |
07 Oct 05 |
nicklas |
99 |
userQuery.order(Orders.asc(Hql.property("name"))); |
6322 |
11 Sep 13 |
nicklas |
100 |
|
6322 |
11 Sep 13 |
nicklas |
101 |
JSONObject jsonUsers = new JSONObject(); |
6322 |
11 Sep 13 |
nicklas |
102 |
jsonShare.add(jsonUsers); |
6322 |
11 Sep 13 |
nicklas |
103 |
jsonUsers.put("itemType", "USER"); |
6322 |
11 Sep 13 |
nicklas |
104 |
jsonUsers.put("name", "Users"); |
6322 |
11 Sep 13 |
nicklas |
105 |
jsonUsers.put("items", JsonUtil.toArray(userQuery.iterate(dc), |
6322 |
11 Sep 13 |
nicklas |
106 |
new NameableConverter<User>() |
6204 |
14 Nov 12 |
nicklas |
107 |
{ |
6322 |
11 Sep 13 |
nicklas |
108 |
protected void setMore(JSONObject json, User user) |
6322 |
11 Sep 13 |
nicklas |
109 |
{ |
6322 |
11 Sep 13 |
nicklas |
110 |
Map<ItemKey, Set<Permission>> p = mp.getPermissions(user); |
6322 |
11 Sep 13 |
nicklas |
111 |
int permissionCode = 0; |
6322 |
11 Sep 13 |
nicklas |
112 |
String permissionString = "varying"; |
6322 |
11 Sep 13 |
nicklas |
113 |
if (MultiPermissions.allSame(p.values())) |
6322 |
11 Sep 13 |
nicklas |
114 |
{ |
6322 |
11 Sep 13 |
nicklas |
115 |
Set<Permission> first = p.values().iterator().next(); |
6322 |
11 Sep 13 |
nicklas |
116 |
permissionCode = PermissionUtil.getPermissionCode(first); |
7212 |
19 Oct 16 |
nicklas |
117 |
permissionString = PermissionUtil.translatePermissionsToString(first, hasAnnotatableItem ? "A" : null); |
6322 |
11 Sep 13 |
nicklas |
118 |
} |
6322 |
11 Sep 13 |
nicklas |
119 |
json.put("name", user.getName() + " [" + permissionString + "]"); |
6322 |
11 Sep 13 |
nicklas |
120 |
json.put("value", permissionCode); |
6322 |
11 Sep 13 |
nicklas |
121 |
} |
6204 |
14 Nov 12 |
nicklas |
122 |
} |
6322 |
11 Sep 13 |
nicklas |
123 |
)); |
6322 |
11 Sep 13 |
nicklas |
124 |
|
620 |
19 May 05 |
nicklas |
125 |
|
620 |
19 May 05 |
nicklas |
126 |
// Query to retrieve groups |
1418 |
07 Oct 05 |
nicklas |
127 |
final ItemQuery<Group> groupQuery = mp.getGroups(); |
1418 |
07 Oct 05 |
nicklas |
128 |
groupQuery.order(Orders.asc(Hql.property("name"))); |
6322 |
11 Sep 13 |
nicklas |
129 |
|
6322 |
11 Sep 13 |
nicklas |
130 |
JSONObject jsonGroups = new JSONObject(); |
6322 |
11 Sep 13 |
nicklas |
131 |
jsonShare.add(jsonGroups); |
6322 |
11 Sep 13 |
nicklas |
132 |
jsonGroups.put("itemType", "GROUP"); |
6322 |
11 Sep 13 |
nicklas |
133 |
jsonGroups.put("name", "Groups"); |
6322 |
11 Sep 13 |
nicklas |
134 |
jsonGroups.put("items", JsonUtil.toArray(groupQuery.iterate(dc), |
6322 |
11 Sep 13 |
nicklas |
135 |
new NameableConverter<Group>() |
6204 |
14 Nov 12 |
nicklas |
136 |
{ |
6322 |
11 Sep 13 |
nicklas |
137 |
protected void setMore(JSONObject json, Group group) |
6322 |
11 Sep 13 |
nicklas |
138 |
{ |
6322 |
11 Sep 13 |
nicklas |
139 |
Map<ItemKey, Set<Permission>> p = mp.getPermissions(group); |
6322 |
11 Sep 13 |
nicklas |
140 |
int permissionCode = 0; |
6322 |
11 Sep 13 |
nicklas |
141 |
String permissionString = "varying"; |
6322 |
11 Sep 13 |
nicklas |
142 |
if (MultiPermissions.allSame(p.values())) |
6322 |
11 Sep 13 |
nicklas |
143 |
{ |
6322 |
11 Sep 13 |
nicklas |
144 |
Set<Permission> first = p.values().iterator().next(); |
6322 |
11 Sep 13 |
nicklas |
145 |
permissionCode = PermissionUtil.getPermissionCode(first); |
7212 |
19 Oct 16 |
nicklas |
146 |
permissionString = PermissionUtil.translatePermissionsToString(first, hasAnnotatableItem ? "A" : null); |
6322 |
11 Sep 13 |
nicklas |
147 |
} |
6322 |
11 Sep 13 |
nicklas |
148 |
json.put("name", group.getName() + " [" + permissionString + "]"); |
6322 |
11 Sep 13 |
nicklas |
149 |
json.put("value", permissionCode); |
6322 |
11 Sep 13 |
nicklas |
150 |
} |
6204 |
14 Nov 12 |
nicklas |
151 |
} |
6322 |
11 Sep 13 |
nicklas |
152 |
)); |
6322 |
11 Sep 13 |
nicklas |
153 |
|
620 |
19 May 05 |
nicklas |
154 |
// Query to retrieve projects |
1418 |
07 Oct 05 |
nicklas |
155 |
final ItemQuery<Project> projectQuery = mp.getProjects(); |
1418 |
07 Oct 05 |
nicklas |
156 |
projectQuery.order(Orders.asc(Hql.property("name"))); |
6322 |
11 Sep 13 |
nicklas |
157 |
|
6322 |
11 Sep 13 |
nicklas |
158 |
JSONObject jsonProjects = new JSONObject(); |
6322 |
11 Sep 13 |
nicklas |
159 |
jsonShare.add(jsonProjects); |
6322 |
11 Sep 13 |
nicklas |
160 |
jsonProjects.put("itemType", "PROJECT"); |
6322 |
11 Sep 13 |
nicklas |
161 |
jsonProjects.put("name", "Projects"); |
6322 |
11 Sep 13 |
nicklas |
162 |
jsonProjects.put("items", JsonUtil.toArray(projectQuery.iterate(dc), |
6322 |
11 Sep 13 |
nicklas |
163 |
new NameableConverter<Project>() |
6204 |
14 Nov 12 |
nicklas |
164 |
{ |
6322 |
11 Sep 13 |
nicklas |
165 |
protected void setMore(JSONObject json, Project project) |
6322 |
11 Sep 13 |
nicklas |
166 |
{ |
6322 |
11 Sep 13 |
nicklas |
167 |
Map<ProjectKey, Set<Permission>> p = mp.getPermissions(project); |
6322 |
11 Sep 13 |
nicklas |
168 |
int permissionCode = 0; |
6322 |
11 Sep 13 |
nicklas |
169 |
String permissionString = "varying"; |
6322 |
11 Sep 13 |
nicklas |
170 |
if (MultiPermissions.allSame(p.values())) |
6322 |
11 Sep 13 |
nicklas |
171 |
{ |
6322 |
11 Sep 13 |
nicklas |
172 |
Set<Permission> first = p.values().iterator().next(); |
6322 |
11 Sep 13 |
nicklas |
173 |
permissionCode = PermissionUtil.getPermissionCode(first); |
7212 |
19 Oct 16 |
nicklas |
174 |
permissionString = PermissionUtil.translatePermissionsToString(first, hasAnnotatableItem ? "A" : null); |
6322 |
11 Sep 13 |
nicklas |
175 |
} |
6322 |
11 Sep 13 |
nicklas |
176 |
json.put("name", project.getName() + " [" + permissionString + "]"); |
6322 |
11 Sep 13 |
nicklas |
177 |
json.put("value", permissionCode); |
6322 |
11 Sep 13 |
nicklas |
178 |
} |
6204 |
14 Nov 12 |
nicklas |
179 |
} |
6322 |
11 Sep 13 |
nicklas |
180 |
)); |
6204 |
14 Nov 12 |
nicklas |
181 |
|
6322 |
11 Sep 13 |
nicklas |
182 |
JSONObject jsonTemplates = new JSONObject(); |
6322 |
11 Sep 13 |
nicklas |
183 |
jsonShare.add(jsonTemplates); |
6322 |
11 Sep 13 |
nicklas |
184 |
jsonTemplates.put("itemType", "PERMISSIONTEMPLATE"); |
6322 |
11 Sep 13 |
nicklas |
185 |
jsonTemplates.put("name", "Permission templates"); |
620 |
19 May 05 |
nicklas |
186 |
|
620 |
19 May 05 |
nicklas |
187 |
final boolean writePermission = true; |
2196 |
27 Apr 06 |
martin |
188 |
|
2196 |
27 Apr 06 |
martin |
189 |
/* |
2196 |
27 Apr 06 |
martin |
190 |
Set the headline with the item's name or, |
2196 |
27 Apr 06 |
martin |
191 |
if there are more then one item, the text 'multiple item' |
2196 |
27 Apr 06 |
martin |
192 |
*/ |
2196 |
27 Apr 06 |
martin |
193 |
String headLine = ""; |
4312 |
26 May 08 |
nicklas |
194 |
Set<SharedItem> currentItems = mp.getItems(); |
2196 |
27 Apr 06 |
martin |
195 |
if(currentItems.size() == 1) |
2196 |
27 Apr 06 |
martin |
196 |
{ |
2196 |
27 Apr 06 |
martin |
197 |
SharedItem item = currentItems.iterator().next(); |
2196 |
27 Apr 06 |
martin |
198 |
if(item instanceof Nameable) |
2196 |
27 Apr 06 |
martin |
199 |
{ |
2196 |
27 Apr 06 |
martin |
200 |
headLine = "Set access permissions -- " + HTML.encodeTags(((Nameable)item).getName()); |
2196 |
27 Apr 06 |
martin |
201 |
} |
2196 |
27 Apr 06 |
martin |
202 |
else |
2196 |
27 Apr 06 |
martin |
203 |
{ |
2218 |
05 May 06 |
nicklas |
204 |
headLine = "Set access permissions -- " + HTML.encodeTags(item.toString()); |
2196 |
27 Apr 06 |
martin |
205 |
} |
2196 |
27 Apr 06 |
martin |
206 |
} |
2196 |
27 Apr 06 |
martin |
207 |
else |
2196 |
27 Apr 06 |
martin |
208 |
{ |
2218 |
05 May 06 |
nicklas |
209 |
headLine = "Set access permissions -- Multiple items (" + currentItems.size() + ")"; |
2196 |
27 Apr 06 |
martin |
210 |
} |
4312 |
26 May 08 |
nicklas |
211 |
boolean hasDirectory = mp.getItems(Item.DIRECTORY).size() > 0; |
620 |
19 May 05 |
nicklas |
212 |
|
620 |
19 May 05 |
nicklas |
213 |
%> |
615 |
18 May 05 |
nicklas |
214 |
<base:page type="popup" title="Set access permissions"> |
6322 |
11 Sep 13 |
nicklas |
215 |
<base:head scripts="linkitems-2.js,~share.js" /> |
6204 |
14 Nov 12 |
nicklas |
216 |
<base:body> |
6204 |
14 Nov 12 |
nicklas |
217 |
<h1><%=headLine%> <base:help helpid="share.setpermissions" /></h1> |
615 |
18 May 05 |
nicklas |
218 |
|
6387 |
18 Dec 13 |
nicklas |
219 |
<div id="page-data" class="datacontainer" |
6322 |
11 Sep 13 |
nicklas |
220 |
data-read="<%=READ_CODE%>" |
6322 |
11 Sep 13 |
nicklas |
221 |
data-use="<%=USE_CODE%>" |
7212 |
19 Oct 16 |
nicklas |
222 |
data-restricted-write="<%=RESTRICTED_WRITE_CODE%>" |
6322 |
11 Sep 13 |
nicklas |
223 |
data-write="<%=WRITE_CODE%>" |
6322 |
11 Sep 13 |
nicklas |
224 |
data-delete="<%=DELETE_CODE%>" |
6322 |
11 Sep 13 |
nicklas |
225 |
data-set-owner="<%=SET_OWNER_CODE%>" |
6322 |
11 Sep 13 |
nicklas |
226 |
data-set-permission="<%=SET_PERMISSION_CODE%>" |
6204 |
14 Nov 12 |
nicklas |
227 |
data-everyone-id="<%=SystemItems.getId(Group.EVERYONE)%>" |
6204 |
14 Nov 12 |
nicklas |
228 |
data-share-to-everyone="<%=sc.hasSystemPermission(Permission.SHARE_TO_EVERYONE) ? 1 : 0%>" |
7212 |
19 Oct 16 |
nicklas |
229 |
data-use-restricted-write="<%=hasAnnotatableItem ? 1 : 0 %>" |
6204 |
14 Nov 12 |
nicklas |
230 |
></div> |
6204 |
14 Nov 12 |
nicklas |
231 |
|
6162 |
10 Oct 12 |
nicklas |
232 |
<form name="share" action="submit_share.jsp"> |
620 |
19 May 05 |
nicklas |
233 |
<input type="hidden" name="ID" value="<%=ID%>"> |
620 |
19 May 05 |
nicklas |
234 |
<input type="hidden" name="cmd" value="Save"> |
620 |
19 May 05 |
nicklas |
235 |
<input type="hidden" name="item_type" value="<%=itemType.name()%>"> |
2218 |
05 May 06 |
nicklas |
236 |
<input type="hidden" name="subcontext" value="<%=subContext%>"> |
6204 |
14 Nov 12 |
nicklas |
237 |
<input type="hidden" name="permissionTemplates" value=""> |
615 |
18 May 05 |
nicklas |
238 |
|
6607 |
19 Nov 14 |
nicklas |
239 |
<div class="content bg-filled-50 bottomborder"> |
5907 |
13 Dec 11 |
nicklas |
240 |
<table style="width: 100%;"> |
5907 |
13 Dec 11 |
nicklas |
241 |
<tr> |
5907 |
13 Dec 11 |
nicklas |
242 |
<td class="padded"><b>Members</b></td> |
5907 |
13 Dec 11 |
nicklas |
243 |
<td class="padded"><b>Permissions</b></td> |
5907 |
13 Dec 11 |
nicklas |
244 |
<td></td> |
5907 |
13 Dec 11 |
nicklas |
245 |
</tr> |
5907 |
13 Dec 11 |
nicklas |
246 |
<tr style="vertical-align: top;"> |
5907 |
13 Dec 11 |
nicklas |
247 |
<td rowspan="2" style="padding-left: 5px; padding-right: 5px;"> |
6322 |
11 Sep 13 |
nicklas |
248 |
<select name="members" id="members" |
6322 |
11 Sep 13 |
nicklas |
249 |
class="auto-init" data-auto-init="link-container" |
6322 |
11 Sep 13 |
nicklas |
250 |
data-initial-items="<%=HTML.encodeTags(jsonShare.toJSONString()) %>" |
6608 |
20 Nov 14 |
nicklas |
251 |
size="14" multiple style="width: calc(100% - 10px);" |
5907 |
13 Dec 11 |
nicklas |
252 |
<%=!writePermission ? "disabled" : ""%>> |
615 |
18 May 05 |
nicklas |
253 |
</select> |
615 |
18 May 05 |
nicklas |
254 |
</td> |
5907 |
13 Dec 11 |
nicklas |
255 |
<td> |
6322 |
11 Sep 13 |
nicklas |
256 |
<input type="checkbox" id="read" checked name="read"><label for="read">Read</label><br> |
6322 |
11 Sep 13 |
nicklas |
257 |
<input type="checkbox" id="use" checked name="use"><label for="use">Use</label><br> |
7212 |
19 Oct 16 |
nicklas |
258 |
<span style="<%=hasAnnotatableItem ? "" : "display: none;"%>"> |
7212 |
19 Oct 16 |
nicklas |
259 |
<input type="checkbox" id="restricted_write" name="restricted_write"><label for="restricted_write">Annotate</label><br> |
7212 |
19 Oct 16 |
nicklas |
260 |
</span> |
6322 |
11 Sep 13 |
nicklas |
261 |
<input type="checkbox" id="write" name="write"><label for="write">Write</label><br> |
6322 |
11 Sep 13 |
nicklas |
262 |
<input type="checkbox" id="delete" name="delete"><label for="delete">Delete</label><br> |
6322 |
11 Sep 13 |
nicklas |
263 |
<input type="checkbox" id="setOwner" name="set_owner"><label for="setOwner">Set owner</label><br> |
6322 |
11 Sep 13 |
nicklas |
264 |
<input type="checkbox" id="setPermission" name="set_permission"><label for="setPermission">Set permission</label><br> |
615 |
18 May 05 |
nicklas |
265 |
</td> |
615 |
18 May 05 |
nicklas |
266 |
<td> |
5907 |
13 Dec 11 |
nicklas |
267 |
<base:buttongroup vertical="true" style="width: 12em;"> |
5907 |
13 Dec 11 |
nicklas |
268 |
<base:button |
6322 |
11 Sep 13 |
nicklas |
269 |
id="btnAddUsers" |
5907 |
13 Dec 11 |
nicklas |
270 |
subclass="leftaligned" |
5907 |
13 Dec 11 |
nicklas |
271 |
title="Add users…" |
5907 |
13 Dec 11 |
nicklas |
272 |
tooltip="Add users" |
5907 |
13 Dec 11 |
nicklas |
273 |
disabled="<%=!writePermission %>" |
5907 |
13 Dec 11 |
nicklas |
274 |
/> |
5907 |
13 Dec 11 |
nicklas |
275 |
<base:button |
6322 |
11 Sep 13 |
nicklas |
276 |
id="btnAddGroups" |
5907 |
13 Dec 11 |
nicklas |
277 |
subclass="leftaligned" |
5907 |
13 Dec 11 |
nicklas |
278 |
title="Add groups…" |
5907 |
13 Dec 11 |
nicklas |
279 |
tooltip="Add groups" |
5907 |
13 Dec 11 |
nicklas |
280 |
disabled="<%=!writePermission %>" |
5907 |
13 Dec 11 |
nicklas |
281 |
/> |
5907 |
13 Dec 11 |
nicklas |
282 |
<base:button |
6322 |
11 Sep 13 |
nicklas |
283 |
id="btnAddProjects" |
5907 |
13 Dec 11 |
nicklas |
284 |
subclass="leftaligned" |
5907 |
13 Dec 11 |
nicklas |
285 |
title="Add projects…" |
5907 |
13 Dec 11 |
nicklas |
286 |
tooltip="Add projects" |
5907 |
13 Dec 11 |
nicklas |
287 |
disabled="<%=!writePermission %>" |
5907 |
13 Dec 11 |
nicklas |
288 |
/> |
5907 |
13 Dec 11 |
nicklas |
289 |
<base:button |
6322 |
11 Sep 13 |
nicklas |
290 |
id="btnAddPermissionTemplates" |
5907 |
13 Dec 11 |
nicklas |
291 |
subclass="leftaligned" |
5907 |
13 Dec 11 |
nicklas |
292 |
title="Templates…" |
5907 |
13 Dec 11 |
nicklas |
293 |
tooltip="Add permission templates" |
5907 |
13 Dec 11 |
nicklas |
294 |
image="add.png" |
5907 |
13 Dec 11 |
nicklas |
295 |
disabled="<%=!writePermission %>" |
5907 |
13 Dec 11 |
nicklas |
296 |
/> |
5907 |
13 Dec 11 |
nicklas |
297 |
<base:button |
6322 |
11 Sep 13 |
nicklas |
298 |
subclass="leftaligned auto-init" |
6322 |
11 Sep 13 |
nicklas |
299 |
data-auto-init="remove-link" |
6322 |
11 Sep 13 |
nicklas |
300 |
data-list-id="members" |
6204 |
14 Nov 12 |
nicklas |
301 |
id="btnRemove" |
5907 |
13 Dec 11 |
nicklas |
302 |
title="Remove" |
5907 |
13 Dec 11 |
nicklas |
303 |
tooltip="Remove the selected items from this group" |
5907 |
13 Dec 11 |
nicklas |
304 |
disabled="<%=!writePermission%>" |
5907 |
13 Dec 11 |
nicklas |
305 |
/> |
5907 |
13 Dec 11 |
nicklas |
306 |
</base:buttongroup> |
615 |
18 May 05 |
nicklas |
307 |
</td> |
615 |
18 May 05 |
nicklas |
308 |
</tr> |
4312 |
26 May 08 |
nicklas |
309 |
<tr> |
4312 |
26 May 08 |
nicklas |
310 |
<td colspan="2"> |
4312 |
26 May 08 |
nicklas |
311 |
<% |
4312 |
26 May 08 |
nicklas |
312 |
if (hasDirectory) |
4312 |
26 May 08 |
nicklas |
313 |
{ |
4312 |
26 May 08 |
nicklas |
314 |
%> |
5907 |
13 Dec 11 |
nicklas |
315 |
<input type="checkbox" name="recursive" value="1" id="recursive"> |
6204 |
14 Nov 12 |
nicklas |
316 |
<label for="recursive">Apply permissions to all subdirectories and their files</label> |
4312 |
26 May 08 |
nicklas |
317 |
<% |
4312 |
26 May 08 |
nicklas |
318 |
} |
4312 |
26 May 08 |
nicklas |
319 |
%> |
4312 |
26 May 08 |
nicklas |
320 |
</td> |
4312 |
26 May 08 |
nicklas |
321 |
</tr> |
615 |
18 May 05 |
nicklas |
322 |
</table> |
4141 |
13 Feb 08 |
nicklas |
323 |
|
5977 |
20 Feb 12 |
nicklas |
324 |
<div class="messagecontainer error" id="share_disabled" style="display:none;"> |
4141 |
13 Feb 08 |
nicklas |
325 |
You don't have permission to change permissions for the |
5907 |
13 Dec 11 |
nicklas |
326 |
Everyone group. Please contact the server administrator |
4141 |
13 Feb 08 |
nicklas |
327 |
if you think you should have that permission. |
4141 |
13 Feb 08 |
nicklas |
328 |
</div> |
5907 |
13 Dec 11 |
nicklas |
329 |
|
5907 |
13 Dec 11 |
nicklas |
330 |
</div> |
5907 |
13 Dec 11 |
nicklas |
331 |
</form> |
5907 |
13 Dec 11 |
nicklas |
332 |
|
5907 |
13 Dec 11 |
nicklas |
333 |
<base:buttongroup subclass="dialogbuttons"> |
6204 |
14 Nov 12 |
nicklas |
334 |
<base:button id="btnSave" title="Ok" /> |
6204 |
14 Nov 12 |
nicklas |
335 |
<base:button id="close" title="Cancel" /> |
5907 |
13 Dec 11 |
nicklas |
336 |
</base:buttongroup> |
4141 |
13 Feb 08 |
nicklas |
337 |
|
615 |
18 May 05 |
nicklas |
338 |
</base:body> |
615 |
18 May 05 |
nicklas |
339 |
</base:page> |
620 |
19 May 05 |
nicklas |
340 |
<% |
620 |
19 May 05 |
nicklas |
341 |
} |
620 |
19 May 05 |
nicklas |
342 |
finally |
620 |
19 May 05 |
nicklas |
343 |
{ |
620 |
19 May 05 |
nicklas |
344 |
if (users != null) users.close(); |
620 |
19 May 05 |
nicklas |
345 |
if (groups != null) groups.close(); |
620 |
19 May 05 |
nicklas |
346 |
if (projects != null) projects.close(); |
620 |
19 May 05 |
nicklas |
347 |
if (dc != null) dc.close(); |
620 |
19 May 05 |
nicklas |
348 |
} |
620 |
19 May 05 |
nicklas |
349 |
%> |