summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorJason Croft2016-05-13 10:32:30 -0400
committerJason Croft2016-05-13 10:32:30 -0400
commit930afdc33738a487bd9e596c5d35bc9f686eaaa1 (patch)
treeecda84def1316dfe03251571a85ee9a02ea51cb0 /public
parentedcb766b63694948b91094995ca7720c1ea222c3 (diff)
Show only projects where user is creator, has project access >= 20, or has group access.
Diffstat (limited to 'public')
-rw-r--r--public/js/index.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/public/js/index.js b/public/js/index.js
index a1e0445b..7e692bee 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -1164,7 +1164,10 @@ ui.toolbar.export.snippet.click(function() {
return (a.path_with_namespace < b.path_with_namespace) ? -1 : ((a.path_with_namespace > b.path_with_namespace) ? 1 : 0);
});
data.projects.forEach(function(project) {
- if (!project.snippets_enabled) {
+ if (!project.snippets_enabled
+ || (project.permissions.project_access === null && project.permissions.group_access === null)
+ || (project.permissions.project_access !== null && project.permissions.project_access.access_level < 20))
+ {
return;
}
$('<option>').val(project.id).text(project.path_with_namespace).appendTo("#snippetExportModalProjects");
@@ -1249,7 +1252,10 @@ ui.toolbar.import.snippet.click(function () {
return (a.path_with_namespace < b.path_with_namespace) ? -1 : ((a.path_with_namespace > b.path_with_namespace) ? 1 : 0);
});
data.projects.forEach(function(project) {
- if (!project.snippets_enabled) {
+ if (!project.snippets_enabled
+ || (project.permissions.project_access === null && project.permissions.group_access === null)
+ || (project.permissions.project_access !== null && project.permissions.project_access.access_level < 20))
+ {
return;
}
$('<option>').val(project.id).text(project.path_with_namespace).appendTo("#snippetImportModalProjects");