title: How to programmatically make a user to assign permissions on template?
body: <p>As you all know django admin has a function to give &quot;Permissions&quot; for user on their admin panel ! How to do that programmatically ? For example lets say i have a super user and the user can create staff users under them as multiple roles.</p>
  <p>And how to allow him to assign or add roles when the super user creates a profile on custom build admin panel ( am not asking for djago admin, am asking for custom own built admin panels)</p>
  <p><a href="https://i.stack.imgur.com/pv2Ld.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pv2Ld.jpg" alt="enter image description here" /></a></p>