SecurityProvider: can we set up roles with more conditions?

I want to set roles based on the current environment they are in. In my example it’s a ‘school’.
We know if a user is in a certain school by looking at the subdomain.

A user can have different permissions depending on school, i.e.:
In school 1 the user is a student.
In school 2 the user is an admin.

See this table:

So to set up this role in the security provider, it would have to look like this I think:

However, this would just get the role_id from the first record it can find where the user_id equals to the logged in user.

Any way to add an and operator here so I can also filter on the current school?

Not sure if this is what you looking for, but adding more conditions equals to ‘AND’

hope it helps,
thank you

Thanks for the suggestions!

Then I think I’m nearly there, but just missing the option to add dynamic data to the value.

As I want to input the current school id in there.
image
Example: {{current_schoolid}}

@Teodor is this maybe possible even though not in the UI?