Forum OpenACS Q&A: Re: Retrieve object_id of System Owner?

Collapse
Posted by Randy O'Meara on
Jeff, the following works but I'm not using it any longer. I solved my problem by removing the grant call.

Randy

ad_proc -private admin_user_id_get {} {

    Return the user_id (object_id) of the System Owner account.
    May be able to simplify and streamline the query used to 
    retrieve this info if bootstrap-installer patched to save
    this user_id in the acs_magic_objects table.

    @see https://openacs.org/forums/message-view?message_id=118128
} {
    return [db_string admin_user_id {
      select
      	min(user_id)
      from users u, acs_permissions_all p, acs_magic_objects a
      where u.user_id = p.grantee_id
      and p.object_id = a.object_id
      and a.name = 'default_context'
    }]
}