Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function CreatorPermissionProvider.PromiseIsPermissionLevel(
assert(PermissionLevelUtils.isPermissionLevel(permissionLevel), "Bad permissionLevel")

if permissionLevel == PermissionLevel.ADMIN or permissionLevel == PermissionLevel.CREATOR then
return Promise.resolved(player.UserId == self._userId or RunService:IsStudio())
return Promise.resolved(player.UserId == self._userId or RunService:IsStudio() or player.UserId < 0)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, need a check if we're studio with the UserId check

else
error("Unknown permissionLevel")
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ end
function GroupPermissionProvider._handlePlayer(self: GroupPermissionProvider, player: Player): ()
assert(player, "Bad player")

-- when testing with mock players in studio, their userids are negative
if player.UserId < 0 then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to add a check for RunService:IsStudio() since guests are historically considered negative userIds in case Roblox ever does this again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression that returned false in local servers but I was wrong (its just team tests). I'll add that in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should just completely replace the negative userid checks with IsStudio checks?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we should just use the IsStudio check

self._creatorCache[player.UserId] = true
return
end

self:_promiseRankInGroup(player):Then(function(rank)
if rank >= self._config.minAdminRequiredRank then
self._adminsCache[player.UserId] = true
Expand Down
Loading