Skip to content

Commit

Permalink
Allow Admins to change group -> Private. See #9339
Browse files Browse the repository at this point in the history
Group Owners still cannot change group to Private.
When Admins choose 'Private' they get a warning dialog
  • Loading branch information
Will Moore committed Jul 18, 2012
1 parent ace3f82 commit 638455c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 24 deletions.
4 changes: 2 additions & 2 deletions components/tools/OmeroWeb/omeroweb/webadmin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def __init__(self, name_check=False, *args, **kwargs):
self.fields['members'] = ExperimenterModelMultipleChoiceField(queryset=kwargs['initial']['experimenters'], required=False)


self.fields['permissions'] = forms.ChoiceField(choices=PERMISSION_CHOICES, widget=forms.RadioSelect(), required=True, label="Permissions", help_text="<p class=\"error\">WARNING: It is not possible to <strong>reduce</strong> permissions to <strong>Private</strong> from <strong>Read-Annotate</strong> or <strong>Read-Only</strong> permissions. However, it is possible to <strong>promote</strong> a Private group to be Read-Annotate or Read-Only group.</p>")
self.fields['permissions'] = forms.ChoiceField(choices=PERMISSION_CHOICES, widget=forms.RadioSelect(), required=True, label="Permissions")

self.fields.keyOrder = ['name', 'description', 'owners', 'members', 'permissions']

Expand Down Expand Up @@ -188,7 +188,7 @@ def __init__(self, *args, **kwargs):

self.fields.keyOrder = ['owners', 'members', 'permissions']

permissions = forms.ChoiceField(choices=PERMISSION_CHOICES, widget=forms.RadioSelect(), required=True, label="Permissions", help_text="<p class=\"error\">WARNING: It is not possible to <strong>reduce</strong> permissions to <strong>Private</strong> from <strong>Read-Annotate</strong> or <strong>Read-Only</strong> permissions. However, it is possible to <strong>promote</strong> a Private group to be Read-Annotate or Read-Only group.</p>")
permissions = forms.ChoiceField(choices=PERMISSION_CHOICES, widget=forms.RadioSelect(), required=True, label="Permissions")

class MyAccountForm(NonASCIIForm):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@

}
});

{% if gid %}
{% ifnotequal permissions 0 %}
$('#id_permissions_0').attr('disabled', true);
{% endifnotequal %}
{% endif %}

$('#id_permissions_0').click(function(){
confirm_dialog("Changing group to Private will remove any Annotations etc added under Read-Annotate permissions",
null, "WARNING", ['OK'], null, 180);
});

})
</script>
Expand Down Expand Up @@ -110,11 +109,12 @@ <h1><a href="{% url wagroups %}" style="position:relative; top:-38px; float:righ
</div>
</form>

<p>{% trans "<strong>Private (rw----)</strong>: All data in this group is only visible to the user who owns it and the group owner. Other users cannot see who else is in the group or view their data. The group owner can view the data for other group members but not make any edits (same as read-only behaviour)." %}</p>

<p>{% trans "<strong>Read-Only (rwr---)</strong>: Users in groups with this permission setting can view each others' data, but cannot edit or annotate another user's data. You can view another users' images but not comment, rate or tag their images." %}</p>

<p>{% trans "<strong>Read-Annotate (rwra--)</strong>: Users in a Read-Annotate group can view and annotate the data belonging to other users. You can tag another user's images or use their tags to annotate your own images. You can add comments to their images and save your own rendering settings for each image. However, you cannot edit the names of their images, projects, datasets or tags etc." %}</p>

<p>
Full details on various Permissions levels can be found on the
<a href="http://www.openmicroscopy.org/site/support/omero4/server/permissions/" target="new">
OMERO Permissions
</a>
page.
</p>
</div>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,19 @@

highlightCurrent();

// Disable "Private" perms, unless we're already 'Private' or 'Admin'
{% if gid %}
{% ifnotequal permissions 0 %}
$('#id_permissions_0').attr('disabled', true);
{% if not ome.eventContext.isAdmin %}
$('#id_permissions_0').attr({
'disabled': true,
'title':"Cannot change group to 'Private'"});
{% endif %}

$('#id_permissions_0').click(function(){
confirm_dialog("Changing group to Private will remove any Annotations etc added under Read-Annotate permissions",
null, "WARNING", ['OK'], null, 180);
});
{% endifnotequal %}
{% endif %}

Expand Down Expand Up @@ -119,14 +129,13 @@ <h1><a href="{% url wamyaccount "edit" %}" style="position:relative; top:-38px;
</div>

</form>

</div>
{% endblock %}

{% block metadata_details %}
<p>{% trans "<strong>Private (rw----)</strong>: All data in this group is only visible to the user who owns it and the group owner. Other users cannot see who else is in the group or view their data. The group owner can view the data for other group members but not make any edits (same as read-only behaviour)." %}</p>

<p>{% trans "<strong>Read-Only (rwr---)</strong>: Users in groups with this permission setting can view each others' data, but cannot edit or annotate another user's data. You can view another users' images but not comment, rate or tag their images." %}</p>

<p>{% trans "<strong>Read-Annotate (rwra--)</strong>: Users in a Read-Annotate group can view and annotate the data belonging to other users. You can tag another user's images or use their tags to annotate your own images. You can add comments to their images and save your own rendering settings for each image. However, you cannot edit the names of their images, projects, datasets or tags etc." %}</p>
<p>
Full details on various Permissions levels can be found on the
<a href="http://www.openmicroscopy.org/site/support/omero4/server/permissions/" target="new">
OMERO Permissions
</a>
page.
</p>
</div>
{% endblock %}

0 comments on commit 638455c

Please sign in to comment.