Method: GoodData::Project#invite
- Defined in:
- lib/gooddata/models/project.rb
#invite(email, role, msg = DEFAULT_INVITE_MESSAGE) ⇒ Object
Invites new user to project
TODO: Return invite object
1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 |
# File 'lib/gooddata/models/project.rb', line 1284 def invite(email, role, msg = DEFAULT_INVITE_MESSAGE) GoodData.logger.info("Inviting #{email}, role: #{role}") role_url = nil if role.index('/gdc/').nil? tmp = get_role(role) role_url = tmp.uri if tmp else role_url = role if role_url.nil? end data = { :invitations => [ { :invitation => { :content => { :email => email, :role => role_url, :action => { :setMessage => msg } } } } ] } url = "/gdc/projects/#{pid}/invitations" client.post(url, data) end |