lookml-access-grants
Instructions
- Define Access Grant:
- Defined at the Model level.
- Links a
user_attributeto a set ofallowed_values.
- Apply Access Grant:
- Use
required_access_grants: [grant_name]at the Explore, Join, View, or Field level. - User must match all listed grants to see the object.
- Use
- Best Practices:
- Exact Match:
allowed_valuesmust match the user attribute value distinctively (no wildcards/partial matches). - Additive: Grants are additive. If a View requires Grant A and a Field requires Grant B, the user needs both to see the field.
- Exact Match:
Examples
Basic Access Grant
# In model file
access_grant: can_view_finance {
user_attribute: department
allowed_values: ["finance", "executive"]
}
# In view file
view: finance_data {
required_access_grants: [can_view_finance]
# ...
}
Field-Level Security
dimension: salary {
type: number
sql: ${TABLE}.salary ;;
required_access_grants: [can_view_finance]
}
More from lkrdev/lookml_skills
lookml-view
Use this skill to create or modify LookML Views. Covers basic view definitions, sql_table_name, file organization, and patterns.
23lookml-model
Use this skill when you need to create or modify a LookML Model file (.model.lkml). This includes defining connections, includes, and configuring model-level settings.
22lookml-explore
Use this skill when you need to create or modify a LookML Explore. This includes defining the Explore, joins, access grants, and basic configuration.
21lookml-refinements
Deep dive into LookML includes, refinements (layering), and project structure best practices. Essential for mastering Looker's object-oriented capabilities.
21lookml-fields
Overview of LookML field types (Dimension, Measure, Filter, Parameter) and the role of the `sql` parameter in each. Use this skill to choose the right field type for your data modeling needs.
20lookml-sets
Guide to using LookML sets for grouping fields, controlling visibility, and managing drill paths.
19