How Would I Make This To Be A Group Script

Hello, I need help on making this so that I don’t have to put in the usernames and just make it so if they are in the group and have a specfic rank or role they would have access to the panel.

local module = {"Player USername"}

function module:CheckWhitelist(plr)
	local iswhitelisted = false
	for i,users in pairs(module) do
		if users == plr then
			iswhitelisted = true
		end
	end 
	return iswhitelisted
end
return module

its an admin panel.

local whitelist = require(game.ReplicatedStorage:WaitForChild("Whitelist"))
game.ReplicatedStorage.AdminEvent.OnServerEvent:Connect(function(plr,action,arg1,arg2)
	local iswhitelisted =whitelist:CheckWhitelist(plr.Name)
if iswhitelisted == false then return end

That’s what the whitelist function does

You need to use GetRankInGroup.
https://developer.roblox.com/en-us/api-reference/function/Player/GetRankInGroup

ohhh I got it now, I don’t need to rewite it I can just make the person white listed if they are in rank thanks.