<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _has_perm(self, user, permission):
 """ Check whether the user has the given permission @return True if user is granted with access, False if not. """


        if user.is_superuser:
            return True
        if user.is_active:
            perms = [perm.split('.')[1] for perm in user.get_all_permissions()]
            return permission in perms
        return False