fixup! [#4069] Disallow removal of anon read access from projects when nbhd prevents private projects
diff --git a/Allura/allura/ext/admin/templates/project_groups.html b/Allura/allura/ext/admin/templates/project_groups.html
index ca6b6f5..6a9e269 100644
--- a/Allura/allura/ext/admin/templates/project_groups.html
+++ b/Allura/allura/ext/admin/templates/project_groups.html
@@ -31,7 +31,7 @@
{% macro show_perms_for_role(role) %}
<ul class="permissions">
{% for perm in permissions_by_role[role._id.__str__()] %}
- {% if private_projects or (not private_projects and perm['name'] != 'read') %}
+ {% if private_projects or (not private_projects and perm['name'] != 'read') or (not private_projects and perm['name'] == 'read') and perm['has'] == 'no' %}
<li class="{{perm['has']}}" data-permission="{{perm['name']}}">
{{ g.icons['perm_has_%s'%perm['has']].render(title=perm['text'], closing_tag=False) }}
{{perm['name']}}
@@ -118,6 +118,8 @@
{% block extra_js %}
<script type="text/javascript">
+ window.SF.privateProjectsAllowed = {{ 'true' if private_projects else 'false' }};
+
// these icons are used in the js, so set them up now
var spinner_img = '<img src="{{g.forge_static('images/spinner.gif')}}">';
{% set perm_delete_ico = g.icons['perm_delete'].render(title='', extra_css='deleter') %}
diff --git a/Allura/allura/public/nf/js/project_groups.js b/Allura/allura/public/nf/js/project_groups.js
index 4d128e2..7d84a20 100644
--- a/Allura/allura/public/nf/js/project_groups.js
+++ b/Allura/allura/public/nf/js/project_groups.js
@@ -16,6 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
+/*global SF, $ */
$(function() {
var cval = $.cookie('_session_id');
@@ -89,9 +90,15 @@
perm_link.attr('title',item.text);
if(item.has=="yes"){
perm_icon.attr('class','fa fa-check');
+ if (!SF.privateProjectsAllowed) {
+ perm_holder.hide();
+ }
}
else if(item.has=="inherit"){
perm_icon.attr('class','fa fa-check-circle');
+ if(!SF.privateProjectsAllowed){
+ perm_holder.hide();
+ }
}
else{
perm_icon.attr('class','fa fa-ban');