2014-05-03 19:50:35 +02:00
|
|
|
<?php
|
2014-05-03 22:18:41 +02:00
|
|
|
class ScorePostJob extends AbstractPostJob
|
2014-05-03 19:50:35 +02:00
|
|
|
{
|
|
|
|
const SCORE = 'score';
|
|
|
|
|
|
|
|
public function execute()
|
|
|
|
{
|
|
|
|
$post = $this->post;
|
|
|
|
$score = intval($this->getArgument(self::SCORE));
|
|
|
|
|
|
|
|
UserModel::updateUserScore(Auth::getCurrentUser(), $post, $score);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function requiresPrivilege()
|
|
|
|
{
|
2014-05-04 16:27:15 +02:00
|
|
|
return new Privilege(
|
2014-05-03 19:50:35 +02:00
|
|
|
Privilege::ScorePost,
|
2014-05-04 16:27:15 +02:00
|
|
|
Access::getIdentity($this->post->getUploader()));
|
2014-05-03 19:50:35 +02:00
|
|
|
}
|
|
|
|
}
|