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

Refactor security implementation in biocollect to be consistent #81

Open
m-r-c opened this issue Oct 2, 2015 · 0 comments
Open

Refactor security implementation in biocollect to be consistent #81

m-r-c opened this issue Oct 2, 2015 · 0 comments

Comments

@m-r-c
Copy link
Contributor

m-r-c commented Oct 2, 2015

There seems to be a mix of approaches to security in the current code:

  • some methods are annotated with the PreAuthorise annotation, which is handled by a filter
  • some methods have inline if statements checking security
  • some checks are role-based (e.g. user must be in role X)
  • some checks are behaviour-based (e.g. can user edit X, which might cover multiple roles)

Some other problems:

  • there are a lot of hardcoded strings for role names - these should all be changed to enums.
  • there seems to have been an attempt to re-use the access levels from Ecodata by retrieving the list of strings via a web service: this won't work, since you need to reference the role names in the security checks (hence all the hardcoded strings). Biocollect will need to have an enum of roles which includes all the ecodata roles.

Ideally, all security related checks should be role-based, and should be implemented via the annotation/filter approach.

@pbrenton pbrenton added this to the Core application milestone Dec 3, 2015
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

2 participants