limited-city-59768
02/21/2024, 10:08 AMchilly-king-10285
02/21/2024, 10:08 AMchilly-king-10285
02/21/2024, 10:08 AMlocations relation is not defined as an array. In Ory's permission model, relationships are always many-to-many, which means they should be defined as arrays. Here is the corrected code: typescript class SubRoles implements Namespace{ related : { members: User[] locations: Location[] } } For more information, you can refer to the [Ory documentation](https://www.ory.sh/docs/keto/modeling/create-permission-model#define-relationships-in-the-opl) on defining relationships in the Ory Permission Language.limited-city-59768
02/21/2024, 10:10 AMchilly-king-10285
02/21/2024, 10:10 AMchilly-king-10285
02/21/2024, 10:10 AMSubRole is related to only one Location, you would still define locations as an array in the Ory model, but only add one Location to this array for each SubRole. For more information, you can refer to the [Ory documentation](https://www.ory.sh/docs/keto/modeling/create-permission-model#define-relationships-in-the-opl) on defining relationships in the Ory Permission Language.