SwiftlyS2

IPermissionManager

Interface IPermissionManager

Namespace: SwiftlyS2.Shared.Permissions

Assembly: SwiftlyS2.CS2.dll

public interface IPermissionManager

Methods

AddPermission(ulong, string)

Adds a permission to a player.

void AddPermission(ulong steamId, string permission)
Parameters
  • steamId ulong — The Steam ID of the player.
  • permission string — The permission to add.

AddSubPermission(string, string)

Adds a sub-permission to a permission.

void AddSubPermission(string permission, string subPermission)
Parameters
  • permission string — The permission to add the sub-permission to.
  • subPermission string — The sub-permission to add.

ClearPermission(ulong)

Clear all permission from a player.

void ClearPermission(ulong steamId)
Parameters
  • steamId ulong — The Steam ID of the player.

PlayerHasPermission(ulong, string)

Checks if a player has a permission. Support 'xxx.*' for wildcard permissions.

bool PlayerHasPermission(ulong steamId, string permission)
Parameters
  • steamId ulong — The Steam ID of the player.
  • permission string — The permission to check.
Returns
  • bool — True if the player has the permission, false otherwise.

PlayerHasPermissions(ulong, IEnumerable<string>)

Checks if a player has all permissions in the list. Support 'xxx.*' for wildcard permissions.

bool PlayerHasPermissions(ulong steamId, IEnumerable<string> permissions)
Parameters
Returns
  • bool — True if the player has all the permissions, false otherwise.

RemovePermission(ulong, string)

Removes a permission from a player.

void RemovePermission(ulong steamId, string permission)
Parameters
  • steamId ulong — The Steam ID of the player.
  • permission string — The permission to remove.

RemoveSubPermission(string, string)

Removes a sub-permission from a permission.

void RemoveSubPermission(string permission, string subPermission)
Parameters
  • permission string — The permission to remove the sub-permission from.
  • subPermission string — The sub-permission to remove.

On this page

IPermissionManager