# Set user permissions per user per area

**URL:** https://community.qfield.org/t/set-user-permissions-per-user-per-area/1378
**Category:** Advanced Use & Customization
**Created:** [9 December 2025 12:15 UTC](https://community.qfield.org/t/set-user-permissions-per-user-per-area/1378 "2025-12-09T12:15:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Jeroen-GroeneBij](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/jeroen-groenebij/32/905_2.png) [@Jeroen-GroeneBij](https://community.qfield.org/u/Jeroen-GroeneBij)
#### Post date: [9 December 2025 12:15 UTC](https://community.qfield.org/t/set-user-permissions-per-user-per-area/1378/1 "2025-12-09T12:15:32Z")

</div>

Hi there,

I was looking for a way to prevent users to update features outside a designated area. The idea is to use the cloud\_username variable as defining value. A cloud username is assigned to a certain area by a project manager so that user can only update features or add new features, etc. within that area.

My first idea was to use the Geofencing option and apply a filter to the geofencing layer. However, that doesn’t work. QGIS can not handle variables in a filter statement.

So, here is my workaround:  
Use a polygon layer which defines the boundaries of working areas e.g. work\_areas

Add an attribute, e.g. surveyor, and fill this attribute with the cloud username of the surveyor who is allowed to work in the respective areas.

Now consider a point layer to be updated out in the field.

For the editable layer set the permissions:  
 ![afbeelding](https://europe1.discourse-cdn.com/flex018/uploads/qfield/optimized/1X/21ef9952ce81eaa50eaf86a16d0fb898f6114312_2_690x80.png)  
Use the following expression to disable certain actions:

> CASE WHEN @cloud\_username =  
> array\_to\_string(  
> overlay\_within(‘work\_areas’,surveyor))  
> THEN FALSE  
> ELSE TRUE  
> END

This expression will fetch the cloud username value in the field surveyor for the work area polygon that the point feature is in. Then it will check if your cloud\_username is the same as the fetched value.

If it is the same, the result of the expression is FALSE, so the Disable function is not active.

I have not tested this with cases where the editable layer is a linestring or a polygon or when multiple users are allowed to edit within the same work area.

I do think this approach should work in those cases, but you have to change the expression accordingly. For linestrings and polygons you might need to use a different overlay function.  
For multiple eligible users it is more tricky, because you have to check whether a specific cloud\_username is mentioned in the string or array that is the result of the overlay function.

If you happen to be able to test and find working expressions for these use cases, please add them to this topic.

Happy QFielding.
