3 * @file src/Model/PermissionSet.php
6 namespace Friendica\Model;
8 use Friendica\BaseModel;
12 * functions for interacting with the permission set of an object (item, photo, event, ...)
14 class PermissionSet extends BaseModel
17 * Fetch the id of a given permission set. Generate a new one when needed
20 * @param string|null $allow_cid Allowed contact IDs - empty = everyone
21 * @param string|null $allow_gid Allowed group IDs - empty = everyone
22 * @param string|null $deny_cid Disallowed contact IDs - empty = no one
23 * @param string|null $deny_gid Disallowed group IDs - empty = no one
26 * @deprecated since 2020.03, use Repository\PermissionSet instead
27 * @see \Friendica\Repository\PermissionSet->getIdFromACL
29 public static function getIdFromACL(
31 string $allow_cid = null,
32 string $allow_gid = null,
33 string $deny_cid = null,
34 string $deny_gid = null
36 return DI::permissionSet()->getIdFromACL($uid, $allow_cid, $allow_gid, $deny_cid, $deny_gid);
40 * Returns a permission set for a given contact
42 * @param integer $uid User id whom the items belong
43 * @param integer $contact_id Contact id of the visitor
45 * @return array of permission set ids.
47 * @deprecated since 2020.03, use Repository\PermissionSet instead
48 * @see \Friendica\Repository\PermissionSet->selectByContactId
50 public static function get($uid, $contact_id)
52 $permissionSets = DI::permissionSet()->selectByContactId($contact_id, $uid);
54 return $permissionSets->column('id');