forked from FriendsOfSymfony/FOSMessageBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AuthorizerInterface.php
41 lines (36 loc) · 1.01 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 FOS\MessageBundle\Security;
use FOS\MessageBundle\Model\ThreadInterface;
use FOS\MessageBundle\Model\ParticipantInterface;
/**
* Manages permissions to manipulate threads and messages
*
* @author Thibault Duplessis <[email protected]>
*/
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);
}