Quite often I'm controlling Read/Write/Delete table permissions for users with formula's like this.
IFS(
ANY(Select(Staff[Type],[Login Email]=UserEmail()))="Admin","ALL_CHANGES",
ANY(Select(Staff[Type],[Login Email]=UserEmail()))="Manager","ADDS_AND_UPDATES",
ANY(Select(Staff[Type],[Login Email]=UserEmail()))="Instructor","READ_ONLY",
TRUE,"ALL_CHANGES"
)
Since, when a bot runs, it does so without UserEmail(). But it seems a bit clunky and I'd prefer to be able to specify the permissions the Bot has rather than having this sort of fallback permission level. Since with this, if I get it wrong, the user has full permissions 😫
I've tred UserEmail()="" and ISBLANK(UserEmail()) but the results are not consistant.
Can anyone suggest a better option? Except that I probably should be using Switch() for the above formula 😂
Solved! Go to Solution.
To allow any bot full access:
IF(
("Server" = CONTEXT("Host")),
"ALL_CHANGES",
SWITCH(
ANY(Select(Staff[Type],[Login Email]=UserEmail())),
"Admin",
"ALL_CHANGES",
"Manager",
"ADDS_AND_UPDATES",
"Instructor",
"READ_ONLY",
"ALL_CHANGES"
)
)
Scheduled bots are run as the app owner.
To allow any bot full access:
IF(
("Server" = CONTEXT("Host")),
"ALL_CHANGES",
SWITCH(
ANY(Select(Staff[Type],[Login Email]=UserEmail())),
"Admin",
"ALL_CHANGES",
"Manager",
"ADDS_AND_UPDATES",
"Instructor",
"READ_ONLY",
"ALL_CHANGES"
)
)
Scheduled bots are run as the app owner.
"Server" = CONTEXT("Host")
thats the bit i was looking for. Thanks @Steve
User | Count |
---|---|
36 | |
32 | |
30 | |
18 | |
16 |