CLASS
# RoomleUserManager
Contents
- Methods
register(identification:password:acceptedTermsAndConditions:newsletter:completion:)
login(identification:password:completion:)
updateUserProfile(_:completion:)
deleteUser(completion:)
logout()
forgotPassword(email:completion:)
getTenants(completion:)
switchTo(tenant:)
Can access user data. Register, login, logout and switching tenants
# Methods
# register(identification:password:acceptedTermsAndConditions:newsletter:completion:)
Will register a new user with given email and password. The user has to manually accept terms and conditions, otherwise this function will fail. This call will also automatically login newly created user.
- parameter identification: email of the user, which should get registered.
- parameter password: password of the user, which should get registered.
- parameter acceptedTermsAndConditions: indicating if the user has accept Roomles' terms and conditions. This has to be true, otherwise it will fail.
- parameter newsletter: indicating if the user wants to receive a newsletter from Roomle.
- parameter completion: block which will be executed with either a user object or an error.
# login(identification:password:completion:)
Will login given user.
- parameter identification: email of the user, which should get logged in.
- parameter password: password of the user, which should get logged in.
- parameter completion: block which will be executed with either a user object or an error.
# updateUserProfile(_:completion:)
Will update profile of given user. You have to change the data of user
.
- parameter user: given profile with values that will be changed
- parameter completion: block which will be executed with new user profile or an error
# deleteUser(completion:)
Will delete logged in user.
- parameter completion: block which will be executed with a success boolean or an error
# logout()
Will logout any logged in user, which means all user related data will be cleared.
# forgotPassword(email:completion:)
Will reset password and send a link to given email address.
- parameter email: email of the user, which password should get reset.
- parameter completion: block which will be executed with a success boolean and an optional error.
# getTenants(completion:)
Will return all tenants, where logged in user is assigned to.
- parameter completion: block which will be executed with either a list of tenants or an error.
# switchTo(tenant:)
Will switch to given tenant, except given tenant is not allowed to be switched to.
- parameter tenant: tenant which should be switched to
- throws: An
RoomleUserManagerError.tenantSwitchNotAllowed
if logged in user is not allowed to switch to given tenant.