- ⌂ repo
- Methods
- Constructor
- execute()
- get()
- get_content_type()
- get_first()
- get_object()
- get_object_by_id()
- get_object_by_oid()
- get_object_by_doid()
- get_object_by_uuid()
- get_objects_by_id()
- get_objects_by_oid()
- get_objects_by_doid()
- get_objects_by_uuid()
- get_root()
- get_row()
- get_rows()
- get_system_property()
- log_alert()
- log_critical()
- log_to_file()
- log_to_html()
- new_collection()
- new_object()
- peek_user()
- pop_user()
- push_super_user()
- push_user()
- query()
- supports_dimensions()
- switch_user()
- uninit()
- with()
repo::peek_user()
Return the current repository user, which is the user whose authorizations will be used to determine which objects are accessible, etc.
Prototype
User peek_user()
Return
The current repository user is returned, as a User object.
Example
$original_user = $repo->peek_user();
$user = $repo->get_first("FROM User WHERE OID=123");
// switch the "user of record" to user with OID 123
$index = $repo->push_user($user);
if($index == FALSE) {
exit("Could not push user.");
}
echo("Switched from $original_user to $user.\n");
// get all contacts user with OID 123 can view
$contacts = $repo->get("SELECT Name FROM Contact");
foreach($contacts as $contact) {
echo($contact->Name . "\n");
}
// return to previous "user of record"
$repo->pop_user($index);