'How can I block command who has no permission in server at pycord?

I used discord.py before, but because of discord.py developing stop, I was changing all code to pycord. Also, I was changing bot's command from text type to slash type.

But, I found that 'has_permission' was not provided at slash_command. But I want to block using command in case who don't have enough permission at server. (ex : No Perm user executed ban command) Is there any way to limit command according to Server user's permission?

#code before rewrite(which don't have error)
@commands.has_permissions(ban_members = True)
@commands.command(name = "ban", usage = "//ban @aaa#0000")
async def ban_command(self, ctx, user_name : discord.Member, *, reason = None):
    if await Permission.check_permission(ctx, 1):
        return None
    await user_name.ban(reason = reason)
    if(reason != None):
        await ctx.reply(str(user_name) + "was banned." + "\nReason : " + str(reason), mention_author = False)
    else:
        await ctx.reply(str(user_name) + "was banned.", mention_author = False)


#code after rewrite(which has error)
@slash_command.has_permissions(ban_members = True)
@slash_command(name = "ban")
async def ban_command(self, ctx, user_name : discord.Member, *, reason = None):
    if await Permission.check_permission(ctx, 1):
        return None
    await user_name.ban(reason = reason)
    if(reason != None):
        await ctx.reply(str(user_name) + "님이 차단되셨습니다." + "\n이유 : " + str(reason), mention_author = False)
    else:
        await ctx.reply(str(user_name) + "님이 차단되셨습니다.", mention_author = False)


Solution 1:[1]

You can use the following if statement to check the user permissions:

if ctx.author.guild_permissions.ban_members:
    # Code for the ban command
else:
    # Respond with an Error Message

Currently discord does not have included special permissions like ban members, kick members etc for slash commands so you need to use if statements in the command itself.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Martin