Let SafePerms function also check for UID
Extended permissions check for functions and consts file