• Alex Kalderimis's avatar
    Ensure HasWiki constructs wikis with users as owners · 4577f7af
    Alex Kalderimis authored
    This adds a concept of `default_actor` that `HasWiki` instances must
    implement. This is implemented differently for projects and groups.
    The contract is that `default_actor` must return a User with ownership
    privileges over the object.
    
    Wiki Owner differs from Owner of these models as wiki_owner must have
    the type `User`, but `Project#owner` can be a `Group` for instance.
    Groups can have many owners, so we select the first one, before
    ascending the chain of parent groups.
    
    This is vital since otherwise `HasWiki#wiki` will return wikis that
    cannot save their own pages.
    4577f7af
group_spec.rb 56 KB