本文へスキップ
hdknr blog
戻る

django: has_permが 常に Falseになる

has_perm が常にFalseになる

## 無効ユーザーだから(User.is_active == False)

django.contrib.auth.backends.py:

class BaseBackend:
    def has_perm(self, user_obj, perm, obj=None):
        # ユーザーが有効の時だけパーミッション判定する
        return user_obj.is_active and super().has_perm(user_obj, perm, obj=obj)

キャッシュがのこっているため



前の記事
django-mptt: tree_idの重複問題
次の記事
MySQL: ERROR 1553 (HY000): Cannot drop index 'uniq_profit': needed in a foreign key constraint