Hey all! Having minor issues with the securi...

expressions
(Miranda Lubarsky) #1

Hey all!

Having minor issues with the security filter for the views.

Using this expression:

OR((USERNAME() = email#1), (USERNAME() = email#2), (USERNAME() = email#3), etc)

And I have my own email in there, but for some reason I’m not seeing the view after I save and verify.

Any thoughts on why?

Basically, I want only people from the construction crew or maintenance crew (I have this listed in a separate place) to be able to view it.

But those expressions were being a pain and not showing what I needed, so I tried just straight-up listing username addresses.

But now I’m not sure this is working either…

Thoughts?

(Steven Coile) #2

I don’t think this is the problem, but you could greatly simplify your expression by writing it instead as in(useremail(), {email#1, email#2, email#3, …}).

(Steven Coile) #3

Ah. Do you want username(), or useremail()? I’d think useremail().

(Miranda Lubarsky) #4

@Steven_Coile useremail, although i do have a list of employees with their

useremails and the crew they are on.

I tried writing a lookup expression to say that, for example, I wanted everyone on the construction crew to see the view and not other people.

But the loookup only fetched one result.

I want it to show it to all the people on the list.

Should i use a lookup? Or something else?

(Steven Coile) #5

@Miranda_Lubarsky In this case, you would probably want to use a select() rather than lookup(). But let’s start with getting the expression you posted initially working. I suspect the reason this:

OR((USERNAME() = email#1), (USERNAME() = email#2), (USERNAME() = email#3), etc)

didn’t work is because you used username() (user name) instead of useremail() (user email). Try changing that and see what happens.