Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission-based CSS Suggestion #14

Open
RossGosling opened this issue Mar 18, 2022 · 2 comments
Open

Permission-based CSS Suggestion #14

RossGosling opened this issue Mar 18, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@RossGosling
Copy link

Hey, found this module exceptionally useful!

One suggestion I thought of was defining CSS by permission groups?
Allowing CSS to be configured for Players, Trusted Players, Assistant GMs, and GMs.

Example cases could be

  • Hiding Death Saves on Player's sheets
  • Hiding Menu options for Players
  • Hiding GM scenes for Assistant GMs

These features likely exist elsewhere but the flexibility would be brilliant through CSS

@zeel01
Copy link
Collaborator

zeel01 commented Mar 18, 2022

Most of these are things I would probably recommend a dedicated module for, rather than relying on hiding through stylesheet alone. But they would likely all be possible. The big issue would be that CSS can't actually have "permissions" in the way that other things can. There would be nothing stopping a user from overriding the styles locally, and it's very easy for them to do so. Now, I'm not generally one to worry about players cheating, but it's pretty low hanging fruit.

The issue with grouping by anything more than world/user is a matter of complexity. You will note that the GM can't modify the user-styles for the user, only for themselves, for instance. This is done with minimal complexity because Foundry offers different kinds of settings - "world" scope is used for one, and "client" scope for the other. This brings with it most of the functionality needed for users to have their own CSS along with what the GM adds for the world.

Adding more "slots" for styles would add a lot more complexity, and I'm not sure that it would be worth while for the results.

That being said, I do have an idea that I might pursue. Rather than styles that are configured per-permission or otherwise, it would be relatively easy for the module to insert additional classes into the body of the page, which could then be used to control styles. For instance, if all GM users would have the class .custom-css_isGM on the body of the page, then any style like:

.custom-css_isGM [...selectors...] {
   ...rules...
 }

Would only apply then. It's still absurdly easy to cheat, but also it's not that complicated to add.

I would need to do some experimenting though. I'm not sure if the class list on body remains static, or if anything might clear/reset it which would break the whole thing.

@zeel01 zeel01 added the enhancement New feature or request label Mar 18, 2022
@bland-html
Copy link

Would love to see it though. There are certain hacks I would love to apply (like hiding Scene/Playlist names) or small little spoiler edits that would be super easy through CSS.

I don't love relying on Modules, especially when they do 10 other things that I don't necessarily need them to do, or are too niche for the developer to keep up to date.

I wouldn't even mind the cheating, since it would be extremely hard for them to even know about anyways. Unless all my players play with the Console open, scouring through the code lol, I can't imagine they would ever even find out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants