MCPcopy Create free account
hub / github.com/error311/FileRise / hasAnyExplicitEntry

Method hasAnyExplicitEntry

src/FileRise/Support/ACL.php:833–861  ·  view source on GitHub ↗
(string $user, string $folder)

Source from the content-addressed store, hash-verified

831 }
832
833 private static function hasAnyExplicitEntry(string $user, string $folder): bool
834 {
835 $acl = self::$cache ?? self::loadFresh();
836 $rec = $acl['folders'][$folder] ?? [];
837 $explicit = $rec['explicit'] ?? [];
838 if (is_array($explicit)) {
839 foreach ($explicit as $k => $v) {
840 $key = is_int($k) ? (string)$v : (string)$k;
841 if ($key === '') {
842 continue;
843 }
844 if (strcasecmp($key, $user) === 0 && $v !== null) {
845 return true;
846 }
847 }
848 }
849 foreach (self::BUCKETS as $k) {
850 $arr = $rec[$k] ?? [];
851 if (!is_array($arr) || !count($arr)) {
852 continue;
853 }
854 foreach ($arr as $u) {
855 if (strcasecmp((string)$u, $user) === 0) {
856 return true;
857 }
858 }
859 }
860 return false;
861 }
862
863 private static function userHasAnyExplicitAccess(string $user): bool
864 {

Callers 2

hasGrantMethod · 0.95

Calls 1

loadFreshMethod · 0.95

Tested by

no test coverage detected