From: fstamatelopoulos Date: Wed, 18 Mar 2009 14:22:31 +0000 (+0000) Subject: if not owner don't show the "read for all" option or include it in the update sent... X-Git-Url: https://code.grnet.gr/git/pithos/commitdiff_plain/52938043a6769a6416c24588aa2322149117b869 if not owner don't show the "read for all" option or include it in the update sent to the server --- diff --git a/gss/src/gr/ebs/gss/client/FilePropertiesDialog.java b/gss/src/gr/ebs/gss/client/FilePropertiesDialog.java index 6e2421f..a94e0b5 100644 --- a/gss/src/gr/ebs/gss/client/FilePropertiesDialog.java +++ b/gss/src/gr/ebs/gss/client/FilePropertiesDialog.java @@ -281,14 +281,17 @@ public class FilePropertiesDialog extends DialogBox { } }); - permForAll.add(new Label("Read For All:")); - permForAll.add(readForAll); - permForAll.setSpacing(8); - permForAll.addStyleName("gwt-TabPanelBottom"); permPanel.add(permList); permPanel.add(permButtons); - permPanel.add(permForAll); - permPanel.add(readForAllNote); + //only show the read for all perm if the user is the owner + if (file.getOwner().equals(GSS.get().getCurrentUserResource().getUsername())) { + permForAll.add(new Label("Read For All:")); + permForAll.add(readForAll); + permForAll.setSpacing(8); + permForAll.addStyleName("gwt-TabPanelBottom"); + permPanel.add(permForAll); + permPanel.add(readForAllNote); + } VersionsList verList = new VersionsList(this, images, bodies); verPanel.add(verList); @@ -314,8 +317,6 @@ public class FilePropertiesDialog extends DialogBox { } - - }); HTML removeAllVersion = new HTML("Remove all previous versions?"); vPanel2.add(removeAllVersion); @@ -396,7 +397,9 @@ public class FilePropertiesDialog extends DialogBox { JSONObject json = new JSONObject(); json.put("name", new JSONString(name.getText())); json.put("versioned", JSONBoolean.getInstance(versioned.isChecked())); - json.put("readForAll", JSONBoolean.getInstance(readForAll.isChecked())); + //only update the read for all perm if the user is the owner + if (file.getOwner().equals(GSS.get().getCurrentUserResource().getUsername())) + json.put("readForAll", JSONBoolean.getInstance(readForAll.isChecked())); JSONArray perma = new JSONArray(); int i=0; for(PermissionHolder p : perms){