Skip to main content

Object Types

In order to create and enforce warrants (access rules) for authorization in your system, Warrant needs to understand your system, specifically what resources define it. Object types allow you to model your system's resources by defining the relationships that exist between them and your users as a simple JSON schema.

These object types can then be referenced in warrants to define complex and powerful access control schemes that are enforced in your application at runtime.

For example, let's say that you're using Warrant in your b2b SaaS application that currently offers features to free and paid users. You'll first create an object type for 'tenant' which represents each of your b2b customers. You'll also likely need a 'tier' object type to represent your current tiers (free and paid) as well as a 'feature' object type for each of your application's unique features. Using these object types, you'll be able to create specific warrants to enforce that only the users that are part of a paid tier tenant can access your paid features.

Object type definitions are very flexible, allowing you to express all the possible relationships between your system resources, even hierarchical or inherited relationships.

The /v1/object-types endpoint supports creating, reading and editing your object types.