ah, thanks for that.
Still needs some sanity checking (what if FOO.plist doesn't exist for some reason) but I think the general gist is ok. It will fall back to the local user with the most system time (again, pinched from Tim Sutton) if there is no user on the console. This suits my needs.
It then writes to Conditions.plist so you can write a condition like "
console_user_ad_group_member_of contains foo_group"This is nice a generic and I can specify the group in the condition. The limitation here though it it only lists groups that you are directly a member of.
For nested groups you have to do something different so I had a stab at using the dsmemberutil command
https://github.com/bartreardon/munki_conditions/blob/master/group_check.sh
This is a bit different in that rather than check a user for their groups, it checks a group for user permissions. The nice thing is it get effective permissions so nested groups are not an issue. The downside is that you have to know in advance what groups you want to query. It would be nice in this instance to have dynamic input to the condition scripts (maybe there is, I don't know). My potential solution at this stage is to create a small no_pkg that populates a text file with a list of groups I might want to check. Performance may suffer if this list gets too big though. To write a condition though it's just "foo_group == true"
Bart