Skip to content

Commit 6c7c369

Browse files
authored
Merge pull request #111 from himenekocn/beta
Add ClearPermission Feature
2 parents 2bedf55 + b41f01a commit 6c7c369

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

managed/src/SwiftlyS2.Core/Modules/Permissions/PermissionManager.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,4 +251,14 @@ public void RemoveSubPermission( string permission, string subPermission )
251251

252252
_queryCache = _queryCache.Clear();
253253
}
254-
}
254+
255+
public void ClearPermission( ulong playerId )
256+
{
257+
lock (_lock)
258+
{
259+
_temporaryPlayerPermissions.Remove(playerId);
260+
}
261+
262+
_queryCache = _queryCache.Clear();
263+
}
264+
}

managed/src/SwiftlyS2.Shared/Modules/Permissions/IPermissionManager.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,10 @@ public interface IPermissionManager {
3838
/// <param name="permission"> The permission to remove the sub-permission from. </param>
3939
/// <param name="subPermission"> The sub-permission to remove. </param>
4040
void RemoveSubPermission(string permission, string subPermission);
41-
}
41+
42+
/// <summary>
43+
/// Clear all permission from a player.
44+
/// </summary>
45+
/// <param name="steamId"> The Steam ID of the player. </param>
46+
void ClearPermission(ulong steamId);
47+
}

0 commit comments

Comments
 (0)