couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From garrensmith <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request: Replication fixes
Date Tue, 02 Sep 2014 12:14:22 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message