Github user garrensmith commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/52#discussion_r16983224
--- Diff: app/addons/replication/route.js ---
@@ -32,19 +31,25 @@ function(app, FauxtonAPI, Replication, Views) {
{"name": "Replicate changes from: ", "link": "replication"}
],
defaultView: function(dbname){
- this.databases = new Replication.DBList({});
- this.tasks = new Replication.Tasks({id: "ReplicationTasks"});
+ var isAdmin = FauxtonAPI.session.isUserAdmin();
+
+ this.databases = new Replication.DBList({});
+ if (isAdmin) {
+ this.tasks = new Replication.Tasks({id: "ReplicationTasks"});
+ }
+
this.replication = new Replication.Replicate({});
- this.setView("#dashboard-content", new
Views.ReplicationForm({
+ this.setView("#dashboard-content", new Views.ReplicationForm({
selectedDB: dbname ||"",
- collection: this.databases,
- status: this.tasks
- }));
+ collection: this.databases,
+ status: this.tasks,
--- End diff --
What happens if we pass in an `undefined` value here? If the user isn't an
admin this.tasks will be undefined, will the `ReplicationForm` still work?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---