Update backup logic to use activity logs, not audit logs
This commit is contained in:
parent
cbecfff6da
commit
2fc5a734f9
12 changed files with 222 additions and 159 deletions
|
@ -14,6 +14,7 @@ use Illuminate\Auth\Passwords\CanResetPassword;
|
|||
use Pterodactyl\Traits\Helpers\AvailableLanguages;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Foundation\Auth\Access\Authorizable;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
|
||||
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
|
||||
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
|
||||
|
@ -273,6 +274,15 @@ class User extends Model implements
|
|||
return $this->hasMany(UserSSHKey::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all of the activity logs where this user is the subject — not to
|
||||
* be confused by activity logs where this user is the _actor_.
|
||||
*/
|
||||
public function activity(): MorphToMany
|
||||
{
|
||||
return $this->morphToMany(ActivityLog::class, 'subject', 'activity_log_subjects');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all of the servers that a user can access by way of being the owner of the
|
||||
* server, or because they are assigned as a subuser for that server.
|
||||
|
|
Reference in a new issue