Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Merge requests
  • !1998

Reformulate authorization in example app

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Pablo Brasero requested to merge github/fork/pablobm/reformulate-authorization into main Jun 10, 2021
  • Overview 4
  • Commits 8
  • Pipelines 0
  • Changes 33

Working on https://github.com/thoughtbot/administrate/pull/1941, I'm having issues with the way authorization is currently tested. I'm trying to solve this problem first before I proceed with the linked PR.

Sorry, this is a big PR :-( To make reviews easier, I have put some effort into splitting it into commits with individual descriptions that make as much sense as possible in isolation. I haven't created individual PRs for each because I think that would leave things in a weird intermediate state.

Although there are some changes to Administrate proper, this PR is actually about the specs and the example app. The commits can be grouped as follows:

  1. Actually get Punditize working in the example app (one commit)
  2. Changes to authorization (two commits):
    • Allow override of fragments of the collection partial.
    • Reformulate authorization in example app.
  3. Changes to navigation (two commits):
    • Remove line items from navigation.
    • Bring product meta tags into navigation.
  4. Minor tweaks (three commits):
    • Destroy payments before customers or they'll stay.
    • Create some payments on seed.
    • Less confusing example of authorization.

The only change to Administrate proper is in the first commit of point 2 above, where I extract some parts of the collection partial into smaller partials, allowing them to be overriden more easily.

The example app gets new a new feature where users can "become" a customer with a single click. This provides a simple form of authentication that we can use to test authorization. This feature is visible in the Customers collection:

Links to become a customer and back an admin

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/pablobm/reformulate-authorization