Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lforite/5e02defa8e269bcb0f0989016f5d151f to your computer and use it in GitHub Desktop.
Save lforite/5e02defa8e269bcb0f0989016f5d151f to your computer and use it in GitHub Desktop.
Scala web series Pt. 1 authorize a request based on its truthfulness usage
import AuthorizationOps._
(
(HasClient(request.clientId) &&
HasProjects(request.projects)) &&
(HasPermission("data.write") || ("data.all"))
).authorize(token) {
// your code if authorized
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment