Zuppler Users Client v0.0.5 ZupplerUsers.Auth.Supervisor
Provides oauth toke authorization with zuppler
Dependencies
poolboy, lrucache
Setup
In the app module add a new child supervisor(Zuppler.Auth, []])
Usage
``` user_info = Zuppler.Auth.auth(token)
Authorization.ZupplerAuth.has_any_role?(user_info, "restaurant") Authorization.ZupplerAuth.has_any_role?(user_info, ["restaurant", "channel"]) Authorization.ZupplerAuth.acls_for(user_info, :restaurant) ```
Summary
Functions
Returns the given object ids on which the user has access to. subject must be a keyword
Authetnicates a user by token. Returns user_info if success or nil if not
Verifies if the user has a given role. Roles can be either a single string "admin" or an a list of string ["restaurant", "channel"]. It returns true if the user has any of the given roles
Callback implementation for c::supervisor.init/1
Functions
Returns the given object ids on which the user has access to. subject must be a keyword
Example
Auth.acls_for(user_info, :restaurant) # => [2,3,4]
Verifies if the user has a given role. Roles can be either a single string "admin" or an a list of string ["restaurant", "channel"]. It returns true if the user has any of the given roles