Source-Level Authorization
The#authorize annotation controls who can access a source. This applies an access filter so that specific users or groups can query a source—even if they have access to the package.
Combining with Row Filters
You can combine#authorize with a where: clause to further restrict which rows are visible:
User Attributes
User attributes are values associated with a user—like their region, tenant, or department. They enable dynamic row filtering based on who is querying the data. This is similar to Looker’s user attributes concept. The#bind annotation binds a user attribute from the JWT to a source parameter, which is then used in a where: filter.
How It Works
- Your service calls the Credible API to mint a JWT with user attributes (e.g.,
region='west') - User passes the JWT when querying
- Credible decodes the JWT, extracts attributes, and binds them to source parameters
- Query executes with automatic row filtering based on the user’s attributes
Example: Regional Sales Data
region='west' in their JWT queries this source, they only see rows where sales_region = 'west'.
Example: Embedded Analytics
If you’re building an analytics dashboard for your customers (e.g., using the Publisher SDK), each customer should only see their own data:tenant_id='acme', they only see rows where customer_id = 'acme'.
Have custom access control requirements? Contact us to discuss your use case.