Getting a list of Security Groups and Accounts for a user through the API
By Kyle Hatlestad on Oct 25, 2011
I got an interesting question on one of my previous posts about how to access the list of Security Groups a user can write to through the API. In first looking at it, I thought it would be straightforward and there would be a schema service for this. The one the user tried, GET_SCHEMA_VIEW_FRAGMENT, does indeed return a list of Security Groups, but you can't differentiate between the ones the user can read and which ones they can write to. I looked through the documentation and couldn't find anything related which might work. I thought perhaps by running the CHECKIN_NEW_FORM service which renders the check-in page template might offer a resultset to use, but no luck there.
The solution comes from a service buried in the std_services.htm file called GET_USER_PERMISSIONS. When you run this service as the user, it will return the list of Security Groups and Accounts along with the level of access for that entity (1=read, 3=write, 7=delete, 15=admin). If you access the service through the URL and add the '&IsPageDebug=1', you can see the results as such: