mirror of
https://github.com/verdigado/organization_folders.git
synced 2024-11-23 05:00:27 +01:00
24 lines
676 B
PHP
24 lines
676 B
PHP
<?php
|
|
|
|
namespace OCA\OrganizationFolders\Security;
|
|
|
|
use OCP\IUser;
|
|
|
|
interface VoterInterface {
|
|
public const ACCESS_GRANTED = 1;
|
|
public const ACCESS_ABSTAIN = 0;
|
|
public const ACCESS_DENIED = -1;
|
|
|
|
/**
|
|
* Returns the vote for the given parameters.
|
|
*
|
|
* This method must return one of the following constants:
|
|
* ACCESS_GRANTED, ACCESS_DENIED, or ACCESS_ABSTAIN.
|
|
*
|
|
* @param mixed $subject The subject to secure
|
|
* @param array $attributes An array of attributes associated with the method being invoked
|
|
*
|
|
* @return int either ACCESS_GRANTED, ACCESS_ABSTAIN, or ACCESS_DENIED
|
|
*/
|
|
public function vote(?IUser $user, mixed $subject, array $attributes): int;
|
|
}
|