The name of a user attribute with theuser_attributesubparameter and a list of user attribute values with theallowed_valuessubparameter
Definition
An access grant is a LookML structure defined in a model file that controls access to other LookML structures, specifically Explores, joins, views, and fields. Theaccess_grantparameter defines an access grant.
access_granttakes the name of a user attribute with theuser_attributesubparameter and a list of acceptable values for the user attribute with theallowed_valuessubparameter. Only those users who are assigned one of the allowed values in the specified user attribute can access structures to which the access grant is required.
Once defined, you can use therequired_access_grantsparameter at theExplore,join,view, orfieldlevel to require the access grant to access those structures.
For example, the following LookML creates an access grant calledcan_view_financial_data, which is based on thedepartmentuser attribute. Only those users who are assigned the values"finance"or"executive"in thedepartmentuser attribute are given access to thecan_view_financial_dataaccess grant:
In this example, only users who have the proper user attribute value for thecan_view_financial_dataaccess grant will see thefinancial_data_fielddimension.
You can define multiple access grants in a model, and you can assign multiple access grants to a LookML structure with therequired_access_grantsparameter. In that case, a user must have access toallof the specified access grants to have access to the LookML structure.
For example, the following LookML defines two different access grants:
In this case, only users that have either the value"finance"or the value"executive"assigned to theirdepartmentuser attributeandhave the value"yes"assigned to theirview_payrolluser attribute can access the view.
Examples
Define an access grant that requires users to have either the value"product_management"or the value"engineering"in thedepartmentuser attribute to have access to theengineeringaccess grant:
You can also define access grants withuser attributesthat take numeric or date/time data. To do this, you must enclose the allowed values in double quotes, just as you would with a string. For example, the following access grant references theiduser attribute, which has adata typeofnumber. Only users with theidvalue of 1, 2, 3, 4, or 5 will be granted access:
The following example references the user attributestart_date, which has the data typeDate/Time. Only users who have the value2020-01-01in the user attribute will be granted access:
User-editable user attributes are not allowed with access grants
Access grants cannot accept user attributes that have aUser AccesslevelofEdit. Users can see and edit the values of user attributes that have aUser Accesslevel ofEditon theiraccount page. For security purposes, only user attributes that have aUser Accesslevel ofNoneorVieware allowed withaccess_grant.
Values listed inallowed_valuesmust match user attribute values exactly
access_grantwill work with user attributes that have theString Filter (advanced),Number Filter (advanced), orDate/Time Filter (advanced)data type. But, in order to grant access, the values listed in theallowed_valuesparameter must match the value in the user attributeexactly.
For example, if you created a user attribute callednumeric_rangewith the data typeNumber Filter (advanced), you could use aLooker filter expressionto enter a range of numbers, such as[1, 20]. In that example, the Looker filter expression in the user attribute will return a range of numbers between 1 and 20, inclusive. Sinceaccess_grantrequires an exact match, however, using the parameterallowed_values: ["10"]wouldnotgrant access. To grant access, you would have to useallowed_values: ["[1, 20]"].
This is also true for user attributes that have multiple values. For example, a user attribute with the data typeNumber Filter (advanced)given the value1, 3, 5wouldonlymatch an access grant with the parameterallowed_values: ["1, 3, 5"]. Likewise, an access grant with the parameterallowed_values: ["1"]would not grant access to the user with multiple values in the user attribute. Nor would an access grant with the parameterallowed_values: ["1", "3", "5"]grant access to this user, because, while theallowed_values: []parameter can accept multiple values, none of the three values in theallowed_values: ["1", "3", "5"]parameter matches the user attribute value1, 3, 5exactly. In this case, a user with a user attribute value of1or3or5wouldbe granted access, since each of those values matches one of the options in theallowed_values: ["1", "3", "5"]parameter.
Similarly,access_grantrequires an exact match with user attributes of data typeString Filter (advanced). Unlike typicalLooker filter expressions, using the parameterallowed_values: [ "Ca%" ]doesnotnot match a user attribute with the valuesCanadaorCalifornia. Only a user attribute value of exactlyCa%would be matched and granted access.
Users who are not granted access experience different behavior depending on LookML structure
A user who does not have access to an access grant will experience different behavior depending on which LookML structure they are trying to access. See therequired_access_grantsdocumentation pages at theExplore,join,view, orfieldlevel for information about how access to those structures is restricted.
Access grants at multiple levels are added together
If you nest access grants, the access grants areadditive. For example, you can createrequired_access_grantsfor a viewand createrequired_access_grantsfor a fieldinside the view. In order to see the field, a user must have access grants to both the fieldandthe view. Likewise for joins: If you createrequired_access_grantsfor the views in a join and also createrequired_access_grantsfor the joinof these two views, a user must have access grants to both views and the join in order to see the joined view.
Accessing structures that reference restricted structures
Users can have access to Looks or dashboards that contain LookML objects they don't have access to. In these situations the Look or dashboard will display as if those LookML objects have been removed from the model.
Suppose we have an Explore A, which contains join A, view A, and field A. Next, we place an access restriction on Explore A. As expected, join A, view A, and field A will inherit that restriction, but only when users are interacting with Explore A. If join A, view A, or field A is used in a different Explore B, they will not necessarily have any access restrictions. Therefore, if you plan to re-use LookML elements, we suggest you apply access restrictions at the lowest level possible.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-22 UTC."],[],[],null,["# access_grant\n\n\u003cbr /\u003e\n\nUsage\n-----\n\n```\naccess_grant: access_grant_name {\n user_attribute: user_attribute_name\n allowed_values: [ \"value_1\", \"value_2\" , ... ]\n}\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nDefinition\n----------\n\nAn access grant is a LookML structure defined in a model file that controls access to other LookML structures, specifically Explores, joins, views, and fields. The `access_grant` parameter defines an access grant.\n\n`access_grant` takes the name of a user attribute with the `user_attribute` subparameter and a list of acceptable values for the user attribute with the `allowed_values` subparameter. Only those users who are assigned one of the allowed values in the specified user attribute can access structures to which the access grant is required.\n\nOnce defined, you can use the `required_access_grants` parameter at the [Explore](/looker/docs/reference/param-explore-required-access-grants), [join](/looker/docs/reference/param-explore-join-required-access-grants), [view](/looker/docs/reference/param-view-required-access-grants), or [field](/looker/docs/reference/param-field-required-access-grants) level to require the access grant to access those structures.\n\nFor example, the following LookML creates an access grant called `can_view_financial_data`, which is based on the `department` user attribute. Only those users who are assigned the values `\"finance\"` or `\"executive\"` in the `department` user attribute are given access to the `can_view_financial_data` access grant: \n\n access_grant: can_view_financial_data {\n user_attribute: department\n allowed_values: [ \"finance\", \"executive\" ]\n }\n\nYou then associate the `can_view_financial_data` access grant with a LookML structure using the `required_access_grants` parameter: \n\n dimension: financial_data_field\n ...\n required_access_grants: [can_view_financial_data]\n }\n\nIn this example, only users who have the proper user attribute value for the `can_view_financial_data` access grant will see the `financial_data_field` dimension.\n\nYou can define multiple access grants in a model, and you can assign multiple access grants to a LookML structure with the `required_access_grants` parameter. In that case, a user must have access to *all* of the specified access grants to have access to the LookML structure.\n\nFor example, the following LookML defines two different access grants: \n\n access_grant: can_view_financial_data {\n user_attribute: department\n allowed_values: [ \"finance\", \"executive\" ]\n }\n\n access_grant: can_view_payroll_data {\n user_attribute: view_payroll\n allowed_values: [ \"yes\" ]\n }\n\nThen, in the view file, the `required_access_grants` parameter specifies both access grants: \n\n view: payroll {\n ...\n required_access_grants: [can_view_financial_data, can_view_payroll_data]\n }\n\nIn this case, only users that have either the value `\"finance\"` or the value `\"executive\"` assigned to their `department` user attribute *and* have the value `\"yes\"` assigned to their `view_payroll` user attribute can access the view.\n\nExamples\n--------\n\nDefine an access grant that requires users to have either the value `\"product_management\"` or the value `\"engineering\"` in the `department` user attribute to have access to the `engineering` access grant: \n\n access_grant: engineering {\n user_attribute: department\n allowed_values: [ \"product_management\", \"engineering\" ]\n }\n\nYou can also define access grants with [user attributes](/looker/docs/admin-panel-users-user-attributes) that take numeric or date/time data. To do this, you must enclose the allowed values in double quotes, just as you would with a string. For example, the following access grant references the `id` user attribute, which has a [data type](/looker/docs/admin-panel-users-user-attributes#data_type) of **number** . Only users with the `id` value of 1, 2, 3, 4, or 5 will be granted access: \n\n access_grant: user_id {\n user_attribute: id\n allowed_values: [\"1\", \"2\", \"3\", \"4\", \"5\"]\n }\n\nThe following example references the user attribute `start_date`, which has the data type **Date/Time** . Only users who have the value `2020-01-01` in the user attribute will be granted access: \n\n access_grant: start_date {\n user_attribute: start_date\n allowed_values: [\"2020-01-01\"]\n }\n\nThings to consider\n------------------\n\n### User-editable user attributes are not allowed with access grants\n\nAccess grants cannot accept user attributes that have a [**User Access** level](/looker/docs/admin-panel-users-user-attributes#creating_user_attributes) of **Edit** . Users can see and edit the values of user attributes that have a **User Access** level of **Edit** on their [account page](/looker/docs/user-account#changing_custom_user_settings). For security purposes, only user attributes that have a **User Access** level of **None** or **View** are allowed with `access_grant`.\n\n### Values listed in `allowed_values` must match user attribute values exactly\n\n`access_grant` will work with user attributes that have the **String Filter (advanced)** , **Number Filter (advanced)** , or **Date/Time Filter (advanced)** data type. But, in order to grant access, the values listed in the `allowed_values` parameter must match the value in the user attribute *exactly*.\n\nFor example, if you created a user attribute called `numeric_range` with the data type **Number Filter (advanced)** , you could use a [Looker filter expression](/looker/docs/filter-expressions#string) to enter a range of numbers, such as `[1, 20]`. In that example, the Looker filter expression in the user attribute will return a range of numbers between 1 and 20, inclusive. Since `access_grant` requires an exact match, however, using the parameter `allowed_values: [\"10\"]` would *not* grant access. To grant access, you would have to use `allowed_values: [\"[1, 20]\"]`.\n\nThis is also true for user attributes that have multiple values. For example, a user attribute with the data type **Number Filter (advanced)** given the value `1, 3, 5` would *only* match an access grant with the parameter `allowed_values: [\"1, 3, 5\"]`. Likewise, an access grant with the parameter `allowed_values: [\"1\"]` would not grant access to the user with multiple values in the user attribute. Nor would an access grant with the parameter `allowed_values: [\"1\", \"3\", \"5\"]` grant access to this user, because, while the `allowed_values: []` parameter can accept multiple values, none of the three values in the `allowed_values: [\"1\", \"3\", \"5\"]` parameter matches the user attribute value `1, 3, 5` exactly. In this case, a user with a user attribute value of `1` or `3` or `5` *would* be granted access, since each of those values matches one of the options in the `allowed_values: [\"1\", \"3\", \"5\"]` parameter.\n\nSimilarly, `access_grant` requires an exact match with user attributes of data type **String Filter (advanced)** . Unlike typical [Looker filter expressions](/looker/docs/filter-expressions#string), using the parameter `allowed_values: [ \"Ca%\" ]` does *not* not match a user attribute with the values `Canada` or `California`. Only a user attribute value of exactly `Ca%` would be matched and granted access.\n\n### Users who are not granted access experience different behavior depending on LookML structure\n\nA user who does not have access to an access grant will experience different behavior depending on which LookML structure they are trying to access. See the `required_access_grants` documentation pages at the [Explore](/looker/docs/reference/param-explore-required-access-grants), [join](/looker/docs/reference/param-explore-join-required-access-grants), [view](/looker/docs/reference/param-view-required-access-grants), or [field](/looker/docs/reference/param-field-required-access-grants) level for information about how access to those structures is restricted.\n\n### Access grants at multiple levels are added together\n\nIf you nest access grants, the access grants are *additive* . For example, you can create [`required_access_grants` for a view](/looker/docs/reference/param-view-required-access-grants) and create [`required_access_grants` for a field](/looker/docs/reference/param-field-required-access-grants) inside the view. In order to see the field, a user must have access grants to both the field *and* the view. Likewise for joins: If you create `required_access_grants` for the views in a join and also create [`required_access_grants` for the join](/looker/docs/reference/param-explore-join-required-access-grants) of these two views, a user must have access grants to both views and the join in order to see the joined view.\n\n### Accessing structures that reference restricted structures\n\nUsers can have access to Looks or dashboards that contain LookML objects they don't have access to. In these situations the Look or dashboard will display as if those LookML objects have been removed from the model.\n\nSuppose we have an Explore A, which contains join A, view A, and field A. Next, we place an access restriction on Explore A. As expected, join A, view A, and field A will inherit that restriction, but only when users are interacting with Explore A. If join A, view A, or field A is used in a different Explore B, they will not necessarily have any access restrictions. Therefore, if you plan to re-use LookML elements, we suggest you apply access restrictions at the lowest level possible."]]