[go: up one dir, main page]

Skip to content

Align both *_project_snippet and *_personal_snippet abilities.

The following discussion from !20613 (merged) should be addressed:

  • @reprazent started a discussion: (+7 comments)

    Indeed, I think it would be nice if we could call can?(user, :create_snippet, project) for project snippets and can?(user, :create_snippet, nil) for personal snippets.

It would be helpful if we could merge abilities for personal and project snippets. Since they both live in different policies we can have single abilities like read_snippet, update_snippet, and admin_snippet. create_snippet would be a little bit different since the abilities live in the global policy and also the project one, but it should be doable.

This can make us treat snippets equally no matter the type. We have done this as well before for other objects.