-
Notifications
You must be signed in to change notification settings - Fork 183
/
AuthorizerInterface.php
41 lines (36 loc) · 1.02 KB
/
AuthorizerInterface.php
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
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Ornicar\MessageBundle\Security;
use Ornicar\MessageBundle\Model\ThreadInterface;
use Ornicar\MessageBundle\Model\ParticipantInterface;
/**
* Manages permissions to manipulate threads and messages
*
* @author Thibault Duplessis <thibault.duplessis@gmail.com>
*/
interface AuthorizerInterface
{
/**
* Tells if the current user is allowed
* to see this thread
*
* @param ThreadInterface $thread
* @return boolean
*/
function canSeeThread(ThreadInterface $thread);
/**
* Tells if the current participant is allowed
* to delete this thread
*
* @param ThreadInterface $thread
* @return boolean
*/
function canDeleteThread(ThreadInterface $thread);
/**
* Tells if the current participant is allowed
* to send a message to this other participant
*
* $param ParticipantInterface $participant the one we want to send a message to
* @return boolean
*/
function canMessageParticipant(ParticipantInterface $participant);
}