-- Compiled with roblox-ts v1.2.7 local TS = _G[script] local RunService = game:GetService("RunService") local ZirconBindingType = TS.import(script, script.Parent.Parent.Parent, "Class", "ZirconGroupBuilder").ZirconBindingType local ZirconGroupType do local _inverse = {} ZirconGroupType = setmetatable({}, { __index = _inverse, }) ZirconGroupType.User = 0 _inverse[0] = "User" ZirconGroupType.Moderator = 1 _inverse[1] = "Moderator" ZirconGroupType.Administrator = 2 _inverse[2] = "Administrator" end local ZirconUserGroup do ZirconUserGroup = setmetatable({}, { __tostring = function() return "ZirconUserGroup" end, }) ZirconUserGroup.__index = ZirconUserGroup function ZirconUserGroup.new(...) local self = setmetatable({}, ZirconUserGroup) return self:constructor(...) or self end function ZirconUserGroup:constructor(id, name, configuration) self.id = id self.name = name self.configuration = configuration self.functions = {} self.namespaces = {} self.enums = {} self.members = setmetatable({}, { __mode = "k", }) local permissionSet = {} for name, enabled in pairs(configuration.Permissions) do if type(enabled) == "boolean" and enabled then -- ▼ Set.add ▼ permissionSet[name] = true -- ▲ Set.add ▲ end end self.permissions = permissionSet end function ZirconUserGroup:AddMember(player) -- ▼ Set.add ▼ self.members[player] = true -- ▲ Set.add ▲ end function ZirconUserGroup:GetMembers() return self.members end function ZirconUserGroup:HasMember(player) return self.members[player] ~= nil end function ZirconUserGroup:GetConfiguration() return self.configuration end function ZirconUserGroup:CanJoinGroup(player) local group = self.configuration local canJoinGroup = false if (bit32.band(group.BindType, ZirconBindingType.Group)) ~= 0 then local matchesGroup = group.Groups for _, group in ipairs(matchesGroup) do local _groupRoleOrRank = group.GroupRoleOrRank if type(_groupRoleOrRank) == "string" then local _condition = canJoinGroup if not canJoinGroup then _condition = player:GetRoleInGroup(group.GroupId) == group.GroupRoleOrRank end canJoinGroup = _condition else local _condition = canJoinGroup if not canJoinGroup then _condition = player:GetRankInGroup(group.GroupId) >= group.GroupRoleOrRank end canJoinGroup = _condition end end end if (bit32.band(group.BindType, ZirconBindingType.UserIds)) ~= 0 then local _condition = canJoinGroup if not canJoinGroup then local _userIds = group.UserIds local _userId = player.UserId _condition = table.find(_userIds, _userId) ~= nil end canJoinGroup = _condition end if (bit32.band(group.BindType, ZirconBindingType.Everyone)) ~= 0 then canJoinGroup = true end if (bit32.band(group.BindType, ZirconBindingType.Creator)) ~= 0 then if RunService:IsStudio() then canJoinGroup = true end if game.CreatorType == Enum.CreatorType.Group then local _condition = canJoinGroup if not canJoinGroup then _condition = player:GetRankInGroup(game.CreatorId) >= 255 end canJoinGroup = _condition else local _condition = canJoinGroup if not canJoinGroup then _condition = game.CreatorId == player.UserId end canJoinGroup = _condition end end return canJoinGroup end function ZirconUserGroup:GetName() return self.name end function ZirconUserGroup:GetRank() return self.id end function ZirconUserGroup:GetPermissions() return self.permissions end function ZirconUserGroup:GetPermission(name) return self.configuration.Permissions[name] end function ZirconUserGroup:RegisterFunction(func) local _functions = self.functions local _arg0 = func:GetName() -- ▼ Map.set ▼ _functions[_arg0] = func -- ▲ Map.set ▲ end function ZirconUserGroup:RegisterEnum(enumerable) local _enums = self.enums local _arg0 = enumerable:getEnumName() -- ▼ Map.set ▼ _enums[_arg0] = enumerable -- ▲ Map.set ▲ end function ZirconUserGroup:RegisterNamespace(namespace) local _namespaces = self.namespaces local _arg0 = namespace:GetName() local _arg1 = namespace:ToUserdata() -- ▼ Map.set ▼ _namespaces[_arg0] = _arg1 -- ▲ Map.set ▲ end function ZirconUserGroup:_getFunctions() return self.functions end function ZirconUserGroup:_getNamespaces() return self.namespaces end function ZirconUserGroup:_getEnums() return self.enums end end return { ZirconGroupType = ZirconGroupType, default = ZirconUserGroup, }