MCPcopy
hub / github.com/walterhiggins/ScriptCraft / revokeScripting

Function revokeScripting

src/main/js/modules/classroom/index.js:113–135  ·  view source on GitHub ↗
(player)

Source from the content-addressed store, hash-verified

111 File = java.io.File;
112
113function revokeScripting(player) {
114 if (__plugin.bukkit) {
115 foreach(player.getEffectivePermissions(), function(perm) {
116 if (('' + perm.permission).indexOf('scriptcraft.') == 0) {
117 if (perm.attachment) {
118 perm.attachment.remove();
119 }
120 }
121 });
122 }
123 if (__plugin.canary) {
124 //
125 var Canary = Packages.net.canarymod.Canary;
126 Canary.permissionManager().removePlayerPermission(
127 'scriptcraft.evaluate',
128 player
129 );
130 }
131 var playerName = '' + player.name;
132 playerName = playerName.replace(/[^a-zA-Z0-9_\-]/g, '');
133 var playerDir = new File(playersDir + playerName);
134 unwatchDir(playerDir);
135}
136var autoloadTime = {};
137
138var playerEventHandlers = {};

Callers 1

index.jsFile · 0.85

Calls 1

foreachFunction · 0.85

Tested by

no test coverage detected