'Make this role inherit permissions from the given role.
Permissions are only added, not removed. Does not handle inheritance.'

def inherit_permissions(self, role):

    if (role.course_id and (role.course_id != self.course_id)):
        logging.warning('%s    cannot    inherit    permissions    from    %s    due    to    course_id    inconsistency', self, role)
    for per in role.permissions.all():
        self.add_permission(per)
