Home > ScreenSteps-Live-User-Provisioning-Ruby-Wrapper

ScreenSteps-Live-User-Provisioning-Ruby-Wrapper

ScreenSteps-Live-User-Provisioning-Ruby-Wrapper is a project mainly written in Ruby, it's free.

ActiveResource wrapper for interacting with the ScreenSteps Live User Provisioning API

h1. ScreenSteps Live User Provisioning API Ruby Wrapper

h2. Usage

This library users ActiveResource to interact with the ScreenSteps Live User Provisioning API.

To setup do the following:

require 'sslive_provisioning'
SsliveProvisioning.account = 'youraccount'
SsliveProvisioning.user = 'username'
SsliveProvisioning.password = 'your_password'

h3. Examples

Create a user

Required parameters: login, email, password, password_confirmation, role role can be one of admin, author, editor, reader, api access Optional parameters: first_name, last_name, time_zone

Pass in :send_new_user_email => "1" if you want notifcations to be sent to new users once they are created.

SsliveProvisioning::User.create(:login => "login",
                             :email => "[email protected]",
                             :password => "password",
                             :password_confirmation => "password",
                             :role => "reader"
                             )

quick user find options

SsliveProvisioning::User.find_by_login(login)
SsliveProvisioning::User.find_by_email(email)

update a user's password

user = SsliveProvisioning::User.find_by_email('[email protected]')
user.update_password("newpassword")

get readers, admins, editors, etc. for an account

SsliveProvisioning::User.readers
SsliveProvisioning::User.api_access_users
SsliveProvisioning::User.admins
SsliveProvisioning::User.authors
SsliveProvisioning::User.editors                         

Create a group

Required parameters: title

SsliveProvisioning::Group.create(:title => "My Group")

Add a user to a group (must have a role of reader or api access)

user = SsliveProvisioning::User.find_by_login("bob")
group = SsliveProvisioning::Group.find_by_title("My Group")
group.add_user(user)

remove the user

group.remove_user(user)

Add a user to a space (must have a role of reader or api access)

space = SsliveProvisioning::Space.find("#{id}")
space.add_user(user)

remove the user

space.remove_user(user)

Add a group to a space

space.add_group(group)

remove the group

space.remove_group(group)

see spaces a reader or api access user can access

user = SsliveProvisioning::User.find_by_email('[email protected]')
user.viewable_spaces

see groups for a suer

user.groups

see spaces for a group

group = SsliveProvisioning::Group.find_by_title('My Group')
group.spaces

see users for a group

group.users
Previous:traininglog