-
Notifications
You must be signed in to change notification settings - Fork 743
ACL sample missing, still relevant? #24
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
Comments
Hi @Yberion, thanks for bringing this up. The ACL module is mostly being maintained by the community right now. However, you can still find the ACL samples on this older branch of Spring Security's repository. I'm closing this but feel free to continue the discussion. |
So you suggest that the "ownership" of an object should be checked with a Do you mind providing a very little sample of such system ? I'd like to get the best practice when I'm coding. What if I have 2 ROLES, like
But, people with How would you allow that with a |
I think in your scenario SpEL would work: @Service
public class ArticleSecurityService {
public boolean canReadArticle(Long articleId) {
... apply as many checks as you want to see if the current user can read the article
}
}
@Service
public class ArticleService {
@PreAuthorize("@articleSecurityService.canReadArticle(#articleId)")
public Article getArticle(Long articleId) {
... returns the article
}
} This way you can improve your permissions more easily. |
Just a heads up that I've added those two ACL samples to be included in this repository. This is the ticket for it #22 |
Hello,
Is ACL still relevant nowadays ?
I'm asking this question because there is a reference to "Contacts" and "Document Management System" samples in the doc regarding ACL, but I can't find those samples.
ACL is quite complex and it's hard to use this system without a proper up-to-date sample, so is it still a good system to use if we want to restrict access to a specific object ? (Something like ownership)
Should I use something else ?
Thanks for your time.
The text was updated successfully, but these errors were encountered: