Class | Chef::WebUIUser
In: | lib/chef/webui_user.rb
Parent: | Object

### Methods

admin? admin_exist cdb_destroy cdb_list cdb_load cdb_save create create_design_document destroy encrypt_password generate_salt has_key? json_create list load name= new save set_openid set_password to_json verify_password

### Included Modules

Chef::Mixin::ParamsValidate

### Constants

DESIGN_DOCUMENT | = | { "version" => 3, "language" => "javascript", "views" => { "all" => { "map" => <<-EOJS function(doc) { if (doc.chef_type == "webui_user") { emit(doc.name, doc); } } EOJS

### Attributes

admin | [RW] |
couchdb | [RW] |
couchdb_id | [R] |
couchdb_rev | [R] |
name | [RW] |
openid | [RW] |
password | [R] |
salt | [R] |
validated | [RW] |

### Public Class methods

admin_exist()

return true if an admin user exists. this is pretty expensive (O(n)), should think of a better way (nuo)

cdb_list(inflate=false)

List all the Chef::WebUIUser objects in the CouchDB. If inflate is set to true, you will get the full list of all registration objects. Otherwise, you‘ll just get the IDs

cdb_load(name)

Load an WebUIUser by name from CouchDB

create_design_document(couchdb=nil)

Set up our CouchDB design document

has_key?(name)

Whether or not there is an WebUIUser with this key.

json_create(o)

Create a Chef::WebUIUser from JSON

list(inflate=false)
load(name)

Load a User by name

new(opts={})

Create a new Chef::WebUIUser object.

### Public Instance methods

admin?()
cdb_destroy()

Remove this WebUIUser from the CouchDB

cdb_save()

Save this WebUIUser to the CouchDB

create()

Create the WebUIUser via the REST API

destroy()

Remove this WebUIUser via the REST API

name=(n)
save()

Save this WebUIUser via the REST API

set_openid(given_openid)
set_password(password, confirm_password=password)

Set the password for this object.

to_json(*a)

Serialize this object as a hash

verify_password(given_password)

### Protected Instance methods

encrypt_password(password)
generate_salt()

[Validate]