I had assumed that it would require guild leader to check permissions, but apparently, that's only to set them. The code below should work.
Lua Code:
local _,_,rank=GetGuildInfo("player");-- Get our rank ID (0-based index)
GuildControlSetRank(rank+1);-- Set rank ID to check (1-based index)
local _,_,listen,speak=GuildControlGetRankFlags();-- Get permission flags
if listen and speak then
-- Do stuff
end
PS: Blizzard made a change recently that converted all functions that return 1/
nil to boolean.