*/
public function asAdmin()
{
+ return $this->actingAs($this->getAdmin());
+ }
+
+ /**
+ * Get the current admin user.
+ * @return mixed
+ */
+ public function getAdmin() {
if($this->admin === null) {
$adminRole = \BookStack\Role::getRole('admin');
$this->admin = $adminRole->users->first();
}
- return $this->actingAs($this->admin);
+ return $this->admin;
}
/**
return $this->actingAs($this->editor);
}
+ /**
+ * Get a user that's not a system user such as the guest user.
+ */
+ public function getNormalUser()
+ {
+ return \BookStack\User::where('system_name', '=', null)->get()->last();
+ }
+
/**
* Quickly sets an array of settings.
* @param $settingsArray