<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def permissions(self, actor, inherited=None):
 """ Permissions for this model, plus permissions inherited from the parent. """

        if inherited is not None:
            return inherited | super(BaseScopedNameMixin, self).permissions(actor)
        elif self.parent is not None and isinstance(self.parent, PermissionMixin):
            return self.parent.permissions(actor) | super(BaseScopedNameMixin, self).permissions(actor)
        else:
            return super(BaseScopedNameMixin, self).permissions(actor)