Skip to main content

Perm-Security

A package to enable the integration between Discord's API and Perm-Banana

Features

  • Permission classes for converting Discord's Permissions to Perm-Banana
  • Member Adapters to enable Perm-Banana's extended functionality
  • The ability to create Tokens
  • A TokenStrategy for handling Permissions with Discord's API

How to use it?

from discord import Member
from discord.ext.commands import Cog, Greedy, Context, command

from perm_security.converters import PermissionChannelConverter
from perm_security.MemberAdapter import MemberChannelAdapter
from perm_security.TokenStrategy import BasicTokenStrategy
from perm_security.TokenStrategy.TokenHandlerStrategy import BasicTokenHandlerStrategy

class Security(Cog):
    def __init__(self, bot):
        self.bot = bot
        self.token_strategy = BasicTokenStrategy(BasicTokenHandlerStrategy(bot.scheduler))

    @command(name="generate_toke")
    async def generate_token(
        self,
        ctx: Context,
        permissions: PermissionChannelConverter,
        members: Greedy[Member],
        uses: int = 1
        duration: float = 60.0
    ):
        author = MemberChannelAdapter(ctx.author, ctx.channel)
        await self.token_strategy.generate_token(author, permissions, members, uses, duration)

Release files for perm-security 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for perm-security 0.2.0
File Size Uploaded
perm_security-0.2.0.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for perm-security 0.2.0
File Interpreter ABI Platform
perm_security-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.1 kB

Release files / perm_security-0.2.0.tar.gz

Download URL perm_security-0.2.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
35dbfa99f89cf5f666e3446adeaa9c8d9c0d990d47079cea653455f9217500e9
BLAKE2b-256 checksum
How to use checksums
6de4b5d150ef2031382746e59cbf5cb38255b6e4b9f4bdcd32b960c96d6e4f01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.7.3 Windows/10

Release files / perm_security-0.2.0-py3-none-any.whl

Download URL perm_security-0.2.0-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a61625e9869294cd12668327fe0262b610f2c46ed17c824198571cba2dabbdca
BLAKE2b-256 checksum
How to use checksums
c4dfc3c8cd03d7a81ce174d2c05838bde26e3281a7e6ee5b75a277b26cf87610
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.7.3 Windows/10

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page