0
0
Fork 0
mirror of https://github.com/verdigado/organization_folders.git synced 2024-12-06 11:22:41 +01:00

Added security classes and draft version of ResourceVoter

This commit is contained in:
Jonathan Treffler 2024-11-06 22:11:16 +01:00
parent 22c06b5689
commit 88cb258c2b
11 changed files with 428 additions and 0 deletions

View file

@ -0,0 +1,24 @@
<?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;
}