I need to make a command that can only be executed by someone that has a certain role. I searched around on google and youtube to find a answer but came up with nothing
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Django __str__ returned non-string (type NoneType)
- Evil ctypes hack in python
You can add a decorator on the command to restrict it to only members with specific roles or permissions. The documentation for it is here. It would look like this:
Keep in mind that the
RoleName
string you pass is case sensitive.