Revision b3c3954b
b/src/gr/grnet/pithos/web/client/FilePermissionsDialog.java | ||
---|---|---|
143 | 143 |
private VerticalPanel createSharingPanel() { |
144 | 144 |
VerticalPanel permPanel = new VerticalPanel(); |
145 | 145 |
|
146 |
permList = new PermissionsList(images, file.getPermissions(), file.getOwner(), file.getInheritedPermissionsFrom() != null);
|
|
146 |
permList = new PermissionsList(images, file.getPermissions(), file.getOwner(), false);
|
|
147 | 147 |
permPanel.add(permList); |
148 | 148 |
|
149 |
if (file.getInheritedPermissionsFrom() == null) { |
|
150 |
HorizontalPanel permButtons = new HorizontalPanel(); |
|
151 |
Button add = new Button("Add Group", new ClickHandler() { |
|
152 |
@Override |
|
153 |
public void onClick(ClickEvent event) { |
|
154 |
PermissionsAddDialog dlg = new PermissionsAddDialog(app, app.getAccount().getGroups(), permList, false); |
|
155 |
dlg.center(); |
|
156 |
permList.updatePermissionTable(); |
|
157 |
} |
|
158 |
}); |
|
159 |
add.addStyleName("button"); |
|
160 |
permButtons.add(add); |
|
161 |
permButtons.setCellHorizontalAlignment(add, HasHorizontalAlignment.ALIGN_CENTER); |
|
149 |
HorizontalPanel permButtons = new HorizontalPanel(); |
|
150 |
Button add = new Button("Add Group", new ClickHandler() { |
|
151 |
@Override |
|
152 |
public void onClick(ClickEvent event) { |
|
153 |
PermissionsAddDialog dlg = new PermissionsAddDialog(app, app.getAccount().getGroups(), permList, false); |
|
154 |
dlg.center(); |
|
155 |
permList.updatePermissionTable(); |
|
156 |
} |
|
157 |
}); |
|
158 |
add.addStyleName("button"); |
|
159 |
permButtons.add(add); |
|
160 |
permButtons.setCellHorizontalAlignment(add, HasHorizontalAlignment.ALIGN_CENTER); |
|
162 | 161 |
|
163 |
final Button addUser = new Button("Add User", new ClickHandler() {
|
|
164 |
@Override
|
|
165 |
public void onClick(ClickEvent event) {
|
|
166 |
PermissionsAddDialog dlg = new PermissionsAddDialog(app, app.getAccount().getGroups(), permList, true);
|
|
167 |
dlg.center();
|
|
168 |
permList.updatePermissionTable();
|
|
169 |
}
|
|
170 |
});
|
|
171 |
addUser.addStyleName("button");
|
|
172 |
permButtons.add(addUser);
|
|
173 |
permButtons.setCellHorizontalAlignment(addUser, HasHorizontalAlignment.ALIGN_CENTER);
|
|
162 |
final Button addUser = new Button("Add User", new ClickHandler() { |
|
163 |
@Override |
|
164 |
public void onClick(ClickEvent event) { |
|
165 |
PermissionsAddDialog dlg = new PermissionsAddDialog(app, app.getAccount().getGroups(), permList, true); |
|
166 |
dlg.center(); |
|
167 |
permList.updatePermissionTable(); |
|
168 |
} |
|
169 |
}); |
|
170 |
addUser.addStyleName("button"); |
|
171 |
permButtons.add(addUser); |
|
172 |
permButtons.setCellHorizontalAlignment(addUser, HasHorizontalAlignment.ALIGN_CENTER); |
|
174 | 173 |
|
175 |
permButtons.setSpacing(8); |
|
176 |
permButtons.addStyleName("pithos-TabPanelBottom"); |
|
177 |
permPanel.add(permButtons); |
|
178 |
} |
|
174 |
permButtons.setSpacing(8); |
|
175 |
permButtons.addStyleName("pithos-TabPanelBottom"); |
|
176 |
permPanel.add(permButtons); |
|
179 | 177 |
|
180 | 178 |
final Label readForAllNote = new Label("When this option is enabled, the file will be readable" + |
181 | 179 |
" by everyone. By checking this option, you are certifying that you have the right to " + |
b/src/gr/grnet/pithos/web/client/FolderPermissionsDialog.java | ||
---|---|---|
119 | 119 |
|
120 | 120 |
VerticalPanel permPanel = new VerticalPanel(); |
121 | 121 |
FilePermissionsDialog.Images images = GWT.create(FilePermissionsDialog.Images.class); |
122 |
boolean permsReadonly = folder.getInheritedPermissionsFrom() != null || folder.existChildrenPermissions(); |
|
123 |
permList = new PermissionsList(images, folder.getPermissions(), folder.getOwner(), permsReadonly); |
|
122 |
permList = new PermissionsList(images, folder.getPermissions(), folder.getOwner(), false); |
|
124 | 123 |
permPanel.add(permList); |
125 | 124 |
|
126 |
if (!permsReadonly) { |
|
127 |
HorizontalPanel permButtons = new HorizontalPanel(); |
|
128 |
Button add = new Button("Add Group", new ClickHandler() { |
|
129 |
@Override |
|
130 |
public void onClick(ClickEvent event) { |
|
131 |
PermissionsAddDialog dlg = new PermissionsAddDialog(app, app.getAccount().getGroups(), permList, false); |
|
132 |
dlg.center(); |
|
133 |
} |
|
134 |
}); |
|
135 |
add.addStyleName("button"); |
|
136 |
permButtons.add(add); |
|
137 |
permButtons.setCellHorizontalAlignment(add, HasHorizontalAlignment.ALIGN_CENTER); |
|
138 |
|
|
139 |
Button addUser = new Button("Add User", new ClickHandler() { |
|
140 |
@Override |
|
141 |
public void onClick(ClickEvent event) { |
|
142 |
PermissionsAddDialog dlg = new PermissionsAddDialog(app, app.getAccount().getGroups(), permList, true); |
|
143 |
dlg.center(); |
|
144 |
} |
|
145 |
}); |
|
146 |
addUser.addStyleName("button"); |
|
147 |
permButtons.add(addUser); |
|
148 |
permButtons.setCellHorizontalAlignment(addUser, HasHorizontalAlignment.ALIGN_CENTER); |
|
149 |
permButtons.setSpacing(8); |
|
150 |
permPanel.add(permButtons); |
|
151 |
} |
|
125 |
HorizontalPanel permButtons = new HorizontalPanel(); |
|
126 |
Button add = new Button("Add Group", new ClickHandler() { |
|
127 |
@Override |
|
128 |
public void onClick(ClickEvent event) { |
|
129 |
PermissionsAddDialog dlg = new PermissionsAddDialog(app, app.getAccount().getGroups(), permList, false); |
|
130 |
dlg.center(); |
|
131 |
} |
|
132 |
}); |
|
133 |
add.addStyleName("button"); |
|
134 |
permButtons.add(add); |
|
135 |
permButtons.setCellHorizontalAlignment(add, HasHorizontalAlignment.ALIGN_CENTER); |
|
136 |
|
|
137 |
Button addUser = new Button("Add User", new ClickHandler() { |
|
138 |
@Override |
|
139 |
public void onClick(ClickEvent event) { |
|
140 |
PermissionsAddDialog dlg = new PermissionsAddDialog(app, app.getAccount().getGroups(), permList, true); |
|
141 |
dlg.center(); |
|
142 |
} |
|
143 |
}); |
|
144 |
addUser.addStyleName("button"); |
|
145 |
permButtons.add(addUser); |
|
146 |
permButtons.setCellHorizontalAlignment(addUser, HasHorizontalAlignment.ALIGN_CENTER); |
|
147 |
permButtons.setSpacing(8); |
|
148 |
permPanel.add(permButtons); |
|
152 | 149 |
|
153 | 150 |
inner.add(permPanel); |
154 | 151 |
|
b/src/gr/grnet/pithos/web/client/PermissionsList.java | ||
---|---|---|
72 | 72 |
images = theImages; |
73 | 73 |
owner = theOwner; |
74 | 74 |
permissions = new HashMap<String, Boolean[]>(thePermissions); |
75 |
readonly = inheritsPermissions; |
|
76 | 75 |
permTable.setText(0, 0, "Users/Groups"); |
77 | 76 |
permTable.setText(0, 1, "Read"); |
78 | 77 |
permTable.setText(0, 2, "Write"); |
b/src/gr/grnet/pithos/web/client/foldertree/Folder.java | ||
---|---|---|
288 | 288 |
return owner; |
289 | 289 |
} |
290 | 290 |
|
291 |
public boolean existChildrenPermissions() { |
|
292 |
for (File f : files) |
|
293 |
if (!f.getPermissions().isEmpty() && f.getInheritedPermissionsFrom() == null) |
|
294 |
return true; |
|
295 |
|
|
296 |
for (Folder fo : subfolders) |
|
297 |
if ((!fo.getPermissions().isEmpty() && fo.getInheritedPermissionsFrom() == null) || fo.existChildrenPermissions()) |
|
298 |
return true; |
|
299 |
return false; |
|
300 |
} |
|
301 |
|
|
302 | 291 |
public boolean isShared() { |
303 | 292 |
return !permissions.isEmpty(); |
304 | 293 |
} |
Also available in: Unified diff