#Role Based Permissions
1 messages ยท Page 1 of 1 (latest)
Are you trying to expand on the permissions that foundry has or to just add a way to quickly give permissions to a player by role
2nd one
My need is more about defining groups/roles so that granting a certain permission level to the role/group indirectly gives that permission to the players who are that role/a part of that group.
What if the player has permission and the role takes it away, which would win?
Highest permission wins I guess.
Although the module could have a setting to disallow the allocation of permissions to individuals altogether.
How does this not exist? give me a second, I can answer your question.
There is a module called 'Permission Viewer' which already helps to some degree in having 2 groups of players in one world, since it makes permissions of each document visible on screen. But another mod (or maybe an extension of Permission Viewer) to introduce the notion of permission groups/players roles would be nice, wouldn't it?
The tricky thing is gonna be that permissions are stored for individual IDs per-Document. So, you would either need to extend User with something that knows how to recursively check permissions or iterate through every document in the world updating permissions when the user's group changes.
Permission viewer:
Wouldn't it be easier to just have a list of roles with permissions, then extend the game.user.can function to also check if the user has any of those roles that has that permission. You would essentially be adding a function and overriding another
though this does mean that if any other module overrides the same function in foundry, it would break your module. But thats whay libWrapper is for.
Yeah, that's why I said "extend User"
Oh, okay I misunderstood. lol
I know very little of the FoundryVTT API, I only just started building a system.
But yeah, if this can be implemented with only overrides at User level without having to touch Documents themselves, then it seems to be a reasonable thing to attempt.
It's one of those "in theory, I think it's doable, but I don't envy you trying to do it" things. But if you do pull it off in a flexible and extensible way, it would be a great module to publish
You would also need to hook into the Permission configuration window to provide a list of all roles. But I think that document is pretty generic, meaning it shouldn't be to hard.
Oh I so wanna try this, I'd love making this.
Are you in a rush, I can start it after I update my module today. See if I make any progress over the next few days.
I'm a bit puzzled by the fact that the Permission config sheet is called 'Default Journal Entry Sheet' (sounds like the sheet for journal items themselves..)
you just care about renderPermissionControl
The sheet itself doesn't really matter (sorta a lie but not really)
JournalEntry is the Document name under the hood, IIRC
You would be my hero if you worked on this. ๐
And you'd definitely have a very dedicated beta tester available: me ๐
I think, yes, that this kind of module would have good success in the community.
There's my use case (2+ groups playing in the same world) but I'm sure there are other use cases where people would find it useful.
There is a reddit thread somewhere where a few people were lamenting that it's not an option already in FoundryVTT.
It makes giving access to documents alot easier, instead of setting everyone, you give them a role, and bam, if that role has permission all users in that role has permission
Yeah, I can see it being useful for West Marches games if it's extensible and handles inheritance right
its less clicks
The Default permission usually works for that in the average playgroup. But there are exceptions
I don't think I've ever used Default permission once. lol
It's useful for "and now all the players can see this journal" and stuff like that. But it's basically just one group, not configurable inherited permissions
Either way, I think the idea is really interesting, so I am going to take a look into it and see what I can do. I make no promises.
great if you want all players to have the same permission level yes, but doesn't support multiple groups.
Now I forgot why I even game to this channel. lol
Nice. Well you can already count on me to test it, provide feedback, suggestions and promote it whenever I can ๐
Programmer brain: Ooh, shiny problem
A later step could be to ensure compatibility with the 'Permission Viewer' module (i.e. have a color defined for each role maybe?). Then that'd be the perfect spot for anyone trying to run multiple groups in the same world.
But without it, it'd be great already tbh.
I am almost done fixing the issues CSwendrowski (just to make sure discord doesn't force tag them) caused my module by "borrowing" my design. So once that is up and running I can start working on this.
You can type CSwendrowski, just don't include the @ if you don't want them pinged
Yeah, I did that before with someone else, and discord just @ the person, so now I panic. lol
If I ping people by accident, I just shrug it off. It's not the end of the world
I would have though you can't ping someone in a thread they haven't joined yet. But I never tried. ๐
If you ping them, I think it adds them... I can't recall how it works, either way, panic brain mode means put them in code block. lol
Yeah, pinging someone pulls them into a thread
Alright. Anyway thanks @upbeat fog for taking an interest in this and volunteering. You're a boon to this community. ๐
(I hope this sounds right, I'm French..)
It sounds fine. Its funny you say that... I was just yelling about the translation files in relation to css
I suppose I can offer fr.json files for your modules, in exchange for your work on this permission-related one ๐