-
Notifications
You must be signed in to change notification settings - Fork 126
Open
Description
I'm currently trying to use Ruby SDK to create an application for user management. Came across the cookbook, specifically the manual how to enable and disable users in the project.
After deactivating a user, I can see the user in the deactivated section of the users in the project. Afterwards, I'd like to re-enable the user, but I receive the following message:
undefined method `enable' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/2.3.0/gems/gooddata-2.1.3/lib/gooddata/core/project.rb:63:in `with_project'
from test.rb:14:in `block in <main>'
from /Library/Ruby/Gems/2.3.0/gems/gooddata-2.1.3/lib/gooddata/connection.rb:47:in `with_connection'
from test.rb:13:in `<main>'
I guess, the issue is, that when I type in project.member?('[email protected]') I receive false, as if the user was not in the project, although I see him in the deactivated section.
I really need to deactivate the user and then re-activate him, but it does not seem possible at the moment.
Is this an expected behavior? Are there any workaround?
Code:
# deactivate
GoodData.with_connection('[email protected]', 'abcd1234') do |client|
GoodData.with_project('xxxxxxx') do |project|
pp project.member?('[email protected]') # returns True
user = project.member([email protected]')
user.disable
end
end
# activate back
GoodData.with_connection('[email protected]', 'abcd1234') do |client|
GoodData.with_project('xxxxxxx') do |project|
pp project.member?('[email protected]') # returns False
user = project.member([email protected]') # doesn't initiate
user.enable
end
end
Metadata
Metadata
Assignees
Labels
No labels