app/models/openstax/accounts/group.rb in openstax_accounts-6.1.5 vs app/models/openstax/accounts/group.rb in openstax_accounts-6.1.6
- old
+ new
@@ -113,24 +113,24 @@
def syncing_or_stubbing
syncing || OpenStax::Accounts.configuration.enable_stubbing?
end
def create_openstax_accounts_group
- return false unless requestor
+ return false if requestor.nil? || requestor.is_anonymous?
- OpenStax::Accounts::Api.create_group(requestor, self)
+ OpenStax::Accounts::Api.create_group(requestor, self) if requestor.has_authenticated?
end
def update_openstax_accounts_group
- return false unless requestor
+ return false if requestor.nil? || requestor.is_anonymous?
- OpenStax::Accounts::Api.update_group(requestor, self)
+ OpenStax::Accounts::Api.update_group(requestor, self) if requestor.has_authenticated?
end
def destroy_openstax_accounts_group
- return false unless requestor
+ return false if requestor.nil? || requestor.is_anonymous?
- OpenStax::Accounts::Api.destroy_group(requestor, self)
+ OpenStax::Accounts::Api.destroy_group(requestor, self) if requestor.has_authenticated?
end
end
end