kibook / pmms

Synchronized media player for FiveM and RedM
136 stars 57 forks source link

Permmissions #33

Closed SheeshGaming420 closed 2 years ago

SheeshGaming420 commented 2 years ago

i cant seem to get the perms to work i've tried exec in the server.cfg in multiple ways with no success

TayMcKenzieNZ commented 2 years ago

In your server.cfg, add the following to the top of the file

exec @pmms/permissions.cfg
start pmms

Stop your server, delete your server cache, restart server, join it and approach any TV or radio prop, then type /pmms

TayMcKenzieNZ commented 2 years ago

To allow all players to be able to play custom URLs, in PMMS permissions.cfg, uncomment or add the following line:

add_ace builtin.everyone pmms.customUrl allow

Even with this ace, URLs will be restricted to those allowed by Config.allowedUrls, which includes generally safe sites such as YouTube.

To allow players to use URLs from other sites, you can either add the appropriate pattern to Config.allowedUrls, or uncomment or add the following line to remove the restriction entirely:

add_ace builtin.everyone pmms.anyUrl allow

Keep in mind that media played with pmms is loaded individually by all players, meaning each player will be accessing the URL from their own connection. Therefore, allowing any player to play a random URL can present some risk of exposing players' IP addresses to an attacker playing something from their own web server and logging the connections.

In the config.lua file you can see:

-- Allowed URL patterns for players without pmms.anyUrl
Config.allowedUrls = {
    "^https?://w?w?w?%.?youtube.com/.*$",
    "^https?://w?w?w?%.?youtu.be/.*$",
    "^https?://w?w?w?%.?twitch.tv/.*$"

You can probably add stuff here too