Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce asset permission model #6063

Closed
16 tasks done
sminnee opened this issue Sep 22, 2016 · 4 comments
Closed
16 tasks done

Introduce asset permission model #6063

sminnee opened this issue Sep 22, 2016 · 4 comments

Comments

@sminnee
Copy link
Member

sminnee commented Sep 22, 2016

Acceptance criteria

  • "Viewers" and "Editors" are properties on Folder and Files, with the default to inherit from parent, just like Pages
  • These fields appear on the folder/file detail froms
  • Default canView() and canEdit() implementations make use of these
  • 100,000 files, 1,000 per folder, are supported
  • For debate: should we use new SiteConfig fields for root permission or separate fields for pages and files?
  • Files with canView() = false for the current user aren't displayed in asset admin
  • Files with canEdit() = false for the current user show a readonly from in asset admin

Assumption: existing level of optimisation in SiteTree::batch_permission_check() is sufficient.

Tasks

  • Implement abstract hierarchal permission calculator based on current SiteTree permissions
  • Update SiteTree to use new permission model
  • Update File to use this permission module
  • Update SiteTree unit tests
  • Permission model unit tests
  • Asset admin behat tests for permissions / readonly
  • Verify NFR (100,000 files, 1,000 folders)
  • Ensure readonly mode is visible in the asset-admin
  • Ensure view / editor groups are editable within the asset edit form for files and folders
  • Ensure that multi-select of groups can be done in react (upgrade or create new react component).

Pull Requests


Right now asset-admin is built to respect canView() and canEdit() permissions of files, however there is no default permission model provided.

We should have some permission model built in that allows protected files and folders, similar in concept to the default page permissions.

We may wish to make this functionality provided-by-default but able-to-be-removed, so that developers can replace the default scheme in its entirety with something else.

@tractorcow
Copy link
Contributor

👍

Something like an extremely bare-bones secureassets would be nice.

@sminnee sminnee added this to the CMS 4.0.0-beta1 milestone Sep 26, 2016
@sminnee sminnee modified the milestones: CMS 4.0.0-alpha6, CMS 4.0.0-beta1 Mar 20, 2017
@marcello-silverstripe marcello-silverstripe modified the milestones: CMS 4.0.0-beta1, CMS 4.0.0-alpha7 Apr 25, 2017
@tractorcow tractorcow self-assigned this May 2, 2017
@chillu
Copy link
Member

chillu commented May 3, 2017

We're doing group selection via a simple CheckboxSetField for now, since that already exists as a React component. To be replaced with a react-select based MultiSelectField React component in silverstripe/silverstripe-admin#52

@tractorcow
Copy link
Contributor

All tasks done, pull request coming later.

@tractorcow
Copy link
Contributor

I'll rebase once i18n rewrite and behat fixes are merged and green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants