Skip to content

SecurityExtensions

Nill edited this page Dec 29, 2021 · 1 revision

BotConfigBuilder

Used when building a bot using a BotConfigBuilder.

  • UseSecurity() - Adds the StandardSecurityProvider to the Bot
  • UseSecurity<TProvider> - Adds TProvider security provider to the Bot

Context

  • HasAccess(item, permission[, bool]) - Checks that the current user has the required permission on the specified item and returns true (permitted) or false (denied).

  • AssertSecurity(item, permission[, bool]) - Checks that the current user has the required permission on the specified item and throws an UnauthorizedAccessException if they do not.

ISecurityConsumer

(Examples: Bot, Client)

  • AddStandardSecurity() - Adds the StandardSecurityProvider to the security consumer.
  • AddSingleOwnerSecurity([long]) - Adds the SingleOwnerSecurityProvider to the security consumer with an optional initial OwnerId (user id of the owner).

IAccessList

Methods for helping to manage access lists.

  • AddUser(ISecurityPrincipal, Permission, AccessType, [DateTime]) - Adds a new entry for the ISecurityPrincipal provided.
  • AddUserId(long, Permission, AccessType, [DateTime]) - Adds a new entry for the numeric user id provided.
  • AddEveryone(Permission, AccessType, [DateTime]) - Adds a new entry for the Everyone well-known security principal.
  • AddAuthenticated(Permission, AccessType, [DateTime]) - Adds a new entry for the Authenticated well-known security principal.
  • AddAnonymous(Permission, AccessType, [DateTime]) - Adds a new entry for the Anonymous well-known security principal.

Clone this wiki locally