I am looking at ways of limiting data (pages) visible to users based on their SharePoint group memberships. One option is to run my site on it's own, determine group membership in code, and limit data available, and the other, less attractive option is to deploy my site to several departmental sites, and then determine which data to present according to the parent site that mine is hosted under.
In either case, I need to access some sort of SharePoint API to determine either the location of my site, or the group membership of the logged on user. How can I go about getting this information?