- public static function fetchIDForPost($postarray)
- {
- $condition = ['uid' => $postarray['uid'],
- 'allow_cid' => self::sortPermissions(defaults($postarray, 'allow_cid', '')),
- 'allow_gid' => self::sortPermissions(defaults($postarray, 'allow_gid', '')),
- 'deny_cid' => self::sortPermissions(defaults($postarray, 'deny_cid', '')),
- 'deny_gid' => self::sortPermissions(defaults($postarray, 'deny_gid', ''))];
-
- $set = DBA::selectFirst('permissionset', ['id'], $condition);
-
- if (!DBA::is_result($set)) {
- DBA::insert('permissionset', $condition, true);
-
- $set = DBA::selectFirst('permissionset', ['id'], $condition);
- }
- return $set['id'];
+ public static function getIdFromACL(
+ int $uid,
+ string $allow_cid = null,
+ string $allow_gid = null,
+ string $deny_cid = null,
+ string $deny_gid = null
+ ) {
+ return DI::permissionSet()->getIdFromACL($uid, $allow_cid, $allow_gid, $deny_cid, $deny_gid);