code: def add_permission_logic(model, permission_logic):
      
      if not isinstance(permission_logic, PermissionLogic):
          raise AttributeError(
          '`permission_logic` must be an instance of PermissionLogic')
      if not hasattr(model, '_permission_logics'):
          model._permission_logics = set()
      if not hasattr(model, '_permission_handler'):
          from permission.utils.handlers import registry
          # register default permission handler
          registry.register(model, handler=None)
      model._permission_logics.add(permission_logic)
      # store target model to the permission_logic instance
      permission_logic.model = model
docs: Add permission logic to the model
  
      Parameters
      ----------
      model : django model class
          A django model class which will be treated by the specified permission
          logic
      permission_logic : permission logic instance
          A permission logic instance which will be used to determine permission
          of the model
  
      Examples
      --------
      >>> from django.db import models
      >>> from permission.logics import PermissionLogic
      >>> class Mock(models.Model):
      ...     name = models.CharField('name', max_length=120)
      >>> add_permission_logic(Mock, PermissionLogic())