Lines Matching refs:user

54      * @param UserInterface|null $user
58 public static function isAdmin(UserInterface|null $user = null): bool argument
60 $user ??= self::user();
62 return $user->getPreference(UserInterface::PREF_IS_ADMINISTRATOR) === '1';
69 * @param UserInterface|null $user
73 public static function isManager(Tree $tree, UserInterface|null $user = null): bool argument
75 $user ??= self::user();
77 …return self::isAdmin($user) || $tree->getUserPreference($user, UserInterface::PREF_TREE_ROLE) === …
84 * @param UserInterface|null $user
88 public static function isModerator(Tree $tree, UserInterface|null $user = null): bool argument
90 $user ??= self::user();
93 self::isManager($tree, $user) ||
94 … $tree->getUserPreference($user, UserInterface::PREF_TREE_ROLE) === UserInterface::ROLE_MODERATOR;
101 * @param UserInterface|null $user
105 public static function isEditor(Tree $tree, UserInterface|null $user = null): bool argument
107 $user ??= self::user();
110 self::isModerator($tree, $user) ||
111 … $tree->getUserPreference($user, UserInterface::PREF_TREE_ROLE) === UserInterface::ROLE_EDITOR;
118 * @param UserInterface|null $user
122 public static function isMember(Tree $tree, UserInterface|null $user = null): bool argument
124 $user ??= self::user();
127 self::isEditor($tree, $user) ||
128 … $tree->getUserPreference($user, UserInterface::PREF_TREE_ROLE) === UserInterface::ROLE_MEMBER;
135 * @param UserInterface|null $user
139 public static function accessLevel(Tree $tree, UserInterface|null $user = null): int argument
141 $user ??= self::user();
143 if (self::isManager($tree, $user)) {
147 if (self::isMember($tree, $user)) {
169 public static function user(): UserInterface function in Fisharebest\\Webtrees\\Auth
179 * @param UserInterface $user
183 public static function login(UserInterface $user): void argument
186 Session::put('wt_user', $user->id());
205 * @param UserInterface $user
209 …kComponentAccess(ModuleInterface $module, string $interface, Tree $tree, UserInterface $user): void argument
211 if ($module->accessLevel($tree, $interface) < self::accessLevel($tree, $user)) {
571 * @param UserInterface $user
575 public static function canUploadMedia(Tree $tree, UserInterface $user): bool argument
578 self::isEditor($tree, $user) &&
579 self::accessLevel($tree, $user) <= (int) $tree->getPreference('MEDIA_UPLOAD');