local w,y,Y,K local N={}local E={}function E.GetPermissions(y)local Y=w.Cache:GetData("\080\101\114\109\105\115\115\105\111\110\115")if Y then return Y else local Y=y:Get("\080\101\114\109\105\115\115\105\111\110\115")if Y then w.Cache:SetData("\071\101\116\080\101\114\109\105\115\115\105\111\110\115",Y,{Timeout=w.Timeouts.GetPermissions})return Y end end end return{Init=function(x,M)w=x y=w.Utilities K=M Y=w.Utilities.Services w.Timeouts.GetPermissions=5 y:MergeTables(w.Remote,E)y:MergeTables(w.Remote.Commands,N)end;AfterInit=function(w,y) end}
--[[

	Description: Remote additions
	Author: Sceleratis
	Date: 12/24/2021

--]]


local Root, Utilities, Service, Package;
local RemoteCommands = {}
local Remote = {}


--//// Command-related Client.Remote methods.

--- Retrieves current user permissions from the server. Caches for duration determined by Root.Timeouts.GetPermissions
--- @method GetPermissions
--- @within Client.Remote
--- @return {}
--- @tag System.Admin
function Remote.GetPermissions(self)
	local cached = Root.Cache:GetData("Permissions")
	if cached then
		return cached
	else
		local perms = self:Get("Permissions")
		if perms then
			Root.Cache:SetData("GetPermissions", perms, {
				Timeout = Root.Timeouts.GetPermissions
			})
			return perms
		end
	end
end


--//// Return initializer
return {
	Init = function(cRoot, cPackage)
		Root = cRoot
		Utilities = Root.Utilities
		Package = cPackage
		Service = Root.Utilities.Services

		--// Do init
		Root.Timeouts.GetPermissions = 5
		Utilities:MergeTables(Root.Remote, Remote)
		Utilities:MergeTables(Root.Remote.Commands, RemoteCommands)
	end;

	AfterInit = function(Root, Package)
		--// Do after-init
	end;
}
