~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/core/description/user.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
        CreatedBy      names.UserTag
23
23
        DateCreated    time.Time
24
24
        LastConnection time.Time
25
 
        Access         Access
 
25
        Access         string
26
26
}
27
27
 
28
28
func newUser(args UserArgs) *user {
45
45
        DisplayName_ string    `yaml:"display-name,omitempty"`
46
46
        CreatedBy_   string    `yaml:"created-by"`
47
47
        DateCreated_ time.Time `yaml:"date-created"`
48
 
        Access_      Access    `yaml:"access"`
 
48
        Access_      string    `yaml:"access"`
49
49
        // Can't use omitempty with time.Time, it just doesn't work,
50
50
        // so use a pointer in the struct.
51
51
        LastConnection_ *time.Time `yaml:"last-connection,omitempty"`
81
81
}
82
82
 
83
83
// Access implements User.
84
 
func (u *user) Access() Access {
 
84
func (u *user) Access() string {
85
85
        return u.Access_
86
86
}
87
87
 
132
132
                "read-only":       schema.Bool(),
133
133
                "date-created":    schema.Time(),
134
134
                "last-connection": schema.Time(),
135
 
                "access":          accessField(),
 
135
                "access":          schema.String(),
136
136
        }
137
137
 
138
138
        // Some values don't have to be there.
155
155
                DisplayName_: valid["display-name"].(string),
156
156
                CreatedBy_:   valid["created-by"].(string),
157
157
                DateCreated_: valid["date-created"].(time.Time),
158
 
                Access_:      valid["access"].(Access),
 
158
                Access_:      valid["access"].(string),
159
159
        }
160
160
 
161
161
        lastConn := valid["last-connection"].(time.Time)