Add visibility column to links table #30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Follow-up from spikes #16 (
docs/auth.md) and #17 (docs/visibility.md).Repo
ldraney/palinksUser Story
As Lucas
I want each link to have a visibility level
So that I can control which audience sees which links
Context
The visibility system uses three tiers: public, member, superadmin. Default is
superadmin(safe — new links are private until shared). This migration ships before auth is wired up — all existing links getsuperadmin, meaning no behavioral change until filtering is added in a separate ticket.File Targets
db/migrate/xxx_add_visibility_to_links.rb— new migrationapp/models/link.rb— add VISIBILITY_LEVELS, VISIBILITY_HIERARCHY, visible_to scope, validationFeature Flag
None — schema change with no visible behavior until filtering is wired up.
Acceptance Criteria
visibility: string, default: "superadmin", null: falsepublic,member,superadminLink.visible_to("superadmin")returns all linksLink.visible_to("member")returns public + member linksLink.visible_to("anonymous")returns public links onlysuperadminTest Expectations
visible_toscope returns correct links for each rolebundle exec rails testConstraints
superadmin(safe default perdocs/visibility.md)Checklist
Related
project-palinks— project pagedocs/visibility.md— tier definitionsdocs/auth.md— schema design