How to change some users or groups permission true-false

i want to change some subjects (user-group) permission to false or true…

how to change it true false with script…
Or is there a way to do it?

Get your user or group and use this method SubjectData#setPermission().

https://jd.spongepowered.org/5.0.0-SNAPSHOT/org/spongepowered/api/service/permission/SubjectData.html

1 Like

Thanks i understood this part but what is context?
player.getSubjectData().setPermission(ContextNeededHere ,“griefprotection”,true)

ok i made it null…

You should read that to understand a context.

https://jd.spongepowered.org/5.0.0-SNAPSHOT/org/spongepowered/api/service/context/Context.html

1 Like

the problem is my english and java is not good enough to understand all yet…
im still trying to learn…

A Context object is events or circumstances surrounding the event, which provide extra information. Don’t put null, but if you don’t know what to put, just put ImmutableSet.of();

Player player = (Player)src;
player.getSubjectData().setPermission(set,"minecraft.spawn-protection.override",Tristate.FALSE);

im using this for to set a permission…
SubjectData.GLOBAL_CONTEXT worked somehow…