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

Function isAdminUser

public/js/adminFolderAccess.js:178–192  ·  view source on GitHub ↗
(u)

Source from the content-addressed store, hash-verified

176}
177
178function isAdminUser(u) {
179 if (!u) return false;
180 const username = String(u.username || u.user || '').trim().toLowerCase();
181 const role = u.role ?? u.isAdmin ?? u.admin ?? u.is_admin ?? u.isAdminUser;
182 const roleStr = String(role || '').trim().toLowerCase();
183 return (
184 username === 'admin' ||
185 role === true ||
186 role === 1 ||
187 roleStr === '1' ||
188 roleStr === 'true' ||
189 roleStr === 'admin' ||
190 roleStr === 'superuser'
191 );
192}
193
194function buildFullGrantsForAllFolders(folders) {
195 const allTrue = {

Callers 5

updateUserMetaCacheFunction · 0.85
flagRowFunction · 0.85
loadUserPermissionsListFunction · 0.85
loadUserPermissionsListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected