blob: 20166e702b47f638ce9faa63ec6077c4cbc0be5a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<?php
namespace JsonApi\Routes\Avatar;
use Avatar;
use User;
use Course;
use Institute;
class Authority
{
public static function canShowAvatarOfRange(User $user, Avatar $resource): bool
{
return true;
}
public static function canUpdateAvatarOfUser(User $user): bool
{
return $user->hasPermissionLevel('user', $user);
}
public static function canUpdateAvatarOfInstitute(User $user, Institute $institute): bool
{
return $user->hasPermissionLevel('admin', $institute);
}
public static function canUpdateAvatarOfSeminar(User $user, Course $course): bool
{
return $user->hasPermissionLevel('tutor', $course);
}
}
|