[QUESTION] How do ACL and domain level security work?

  Рет қаралды 7,406

Laur Spilca

Laur Spilca

Күн бұрын

Пікірлер: 36
@krzysztofzabolotny4802
@krzysztofzabolotny4802 3 жыл бұрын
I got an internship and that's my second taks, to implement ACL. God bless you for that.
@baravi2005
@baravi2005 3 жыл бұрын
Super helpful video on Domain object security Laurentiu...also loved your "Spring Security in Action" book!!
@panagiotiskapralos7021
@panagiotiskapralos7021 Жыл бұрын
Thank you, excellent explanation
@laurspilca
@laurspilca Жыл бұрын
Thank you!
@malg5547
@malg5547 2 жыл бұрын
Great explanation, thanks for your time
@Runnable19
@Runnable19 9 ай бұрын
Hello Laur, thanks for the amazing work and for remaining yourself through all these years. I have a question regarding implementing ABAC with spring security, what is the best approach or what libraries exist to make this easier, overall how much would you recommend this over ACL ?
@laurspilca
@laurspilca 9 ай бұрын
Thank you. To be honest I prefer simplicity and never really liked ACLs. But if you need high customization that's I think the only real choice you have with Spring Security.
@eq716
@eq716 5 ай бұрын
thanks a lot! great explanation!
@wkamdem80
@wkamdem80 5 жыл бұрын
for performance, it's possible to add indexes on some columns of the acl_entry table? great video, thanks!
@laurspilca
@laurspilca 5 жыл бұрын
Hi William. Definitely. It is even recommended. In my tutorials I avoid doing this just to focus on the Spring Security part. But in a practical scenario you should do this. Thank you for the question :)
@DavitJibuti
@DavitJibuti 4 жыл бұрын
Thanks for this video! What is the best way to manage "acl" tables? example when registrering new user, you have to add user in "users" table plus add permissions in to "acl" tables for the concrate user (user can modify its details, or maybe user can remove himself, but should not have permission to see or delete other user), does the Spring Security ACL has standart way(Objects/methods) of implementing it or should I implement it mannually?
@laurspilca
@laurspilca 4 жыл бұрын
Hi. Thanks for the question. It really depends on the case which is the best way. All your suggestion could be a good choice for registering the users depending on the scenario :)
@DavitJibuti
@DavitJibuti 4 жыл бұрын
@@laurspilca I desided to use MutableAclServie to manage permissions but, i have some strange case with mutableAclService.createAcl(oi), its adds anonymousUser in to acl_object_identity table in every case, do you have some experiance in it? maybe its not the good place to discuss it but, if you know please let me know. I have the question on stackOverflow also with name "Spring Security ACL allways sets anonymousUser as Owner "
@laurspilca
@laurspilca 4 жыл бұрын
@@DavitJibuti Hey. No, I'm not sure I simply know what the problem is here. I would have to investigate it myself. I usually debug on the framework's code when I get into such a situation.
@Istheresomeoneelseornot15
@Istheresomeoneelseornot15 3 жыл бұрын
thank you for thorough explanation!
@eswarjoan
@eswarjoan 2 жыл бұрын
I don't see this PostFilter is working by username. Because where are you passing the username to validate/filter?. This is simply returning WRITE access objects. If you make more acl entries for one more user, this is filter is failed and we are getting all products irrespective of any users.
@laurspilca
@laurspilca 2 жыл бұрын
True. But I don't think I had any intention for that post filter to show only the user's products. That post filter clearly only checks on the authority. If you want to check on the user, you can always take the principal from the security context and validate that the product belongs to that user.
@Boria7777
@Boria7777 3 жыл бұрын
very useful information. thank!!!
@jameswu800
@jameswu800 3 жыл бұрын
PostFilter("hasPermission(filterObject, 'WRITE')") //Is filterObject defined somewhere? Is it a fixed name? Or any name would work?
@laurspilca
@laurspilca 3 жыл бұрын
Hi. filterObject is a fixed name that always represents the object inside the array or collection the method gets as a parameter.
@MarwanAmeen89
@MarwanAmeen89 5 жыл бұрын
What happened when we post filter with pagination ? Let's say if the first page of the returned results user has no permission to access them how to move to the next page?
@laurspilca
@laurspilca 5 жыл бұрын
Hi Marawan, Great question. It's actually not a problem because findAll() will only return now the allowed records. Observe that @PostFilter only filters the data, it doesn't throw any exception. For the client is completely transparent. They will see on the next page the records they have access to - if any - if not, there will be no next page. I hope this answers your question :) Thanks again!
@MarwanAmeen89
@MarwanAmeen89 5 жыл бұрын
Hi @@laurspilca, thanks for replying out, I am not taking about findall() where pagination happened at front end, I am talking about the findAll(pageabl) with the spring jpa, because let's say my page size is 50 but I am only allowed to view 10 records from the result , my endpoints will return only 10, rather than 50 what if the 50 items are not in permission? I haven't tried that , I am still new the ACL .
@laurspilca
@laurspilca 5 жыл бұрын
@@MarwanAmeen89 Ah. I think I understand your question now. It's actually about @PostFilter, not about ACL. But the rule I know is that @PostFilter can only be used on a Collection or an array. The method you refer to returns a different object which is neither Collection, nor array: Pageable. So applying @PostFilter on it will fail with an exception. But, what can you do is actually move the @PostFilter one more layer to the left, in the service. And then you can filter on the collection returned by the getContent() method of the Pageable object.
@laurspilca
@laurspilca 5 жыл бұрын
@@MarwanAmeen89 Hello again. I have tried to share my opinion with this video. I hope it helps :)_ kzbin.info/www/bejne/q5SWlYqkf7h_Y5o
@syednoorullahshah9194
@syednoorullahshah9194 3 жыл бұрын
does spring acl scale well in enterprise applications ? it looks complicated
@laurspilca
@laurspilca 3 жыл бұрын
Not really. I personally avoid it.
@syednoorullahshah9194
@syednoorullahshah9194 3 жыл бұрын
so what are the alternates. I have a requirement for it
@laurspilca
@laurspilca 3 жыл бұрын
@@syednoorullahshah9194 It depends on the requirement. I can't tell you what the best solution is for a problem whose statement I don't know.
@baravi2005
@baravi2005 3 жыл бұрын
I tried to make it work with in memory H2 database, but was getting some circular reference errors :(
@temptrue3322
@temptrue3322 2 жыл бұрын
Maybe a bit too late, but try to keep GlobalMethodSecurityConfiguration in seperate configuration file and keep acl related configurations in another file
@ramanjaneyas8589
@ramanjaneyas8589 4 жыл бұрын
HI Laurentitu i want know what will be the procedure if we want to perform CRUD operation for the domain object except reading. i tried deleting a domain object by implementing a controller but its throwing forbidden error.. @DeleteMapping("/product/{id}") @PreAuthorize("hasPermission(#id, 'delete')") public void deleteProductById(@PathVariable("id") int id) { productService.deleteProductById(id); }
@laurspilca
@laurspilca 4 жыл бұрын
Hello. I'll create later a lesson in the Spring Security stream about global method security. I hope that one will clarify for you how these annotations work. Stay tuned.
@ramanjaneyas8589
@ramanjaneyas8589 4 жыл бұрын
@@laurspilca okay
@mechtarin
@mechtarin 3 жыл бұрын
49:44 AWESOME
@nourti
@nourti 4 жыл бұрын
great work appreciated
[QUESTION] What is a DTO and how should I use it?
31:44
Laur Spilca
Рет қаралды 10 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
Spring Security: The Good Parts by DANIEL GARNIER-MOIROUX
49:33
Multi-Tenant: Database Per Tenant or Shared?
8:55
CodeOpinion
Рет қаралды 23 М.
Explain it to Me Like I’m 5: Oauth2 and OpenID
47:50
SpringDeveloper
Рет қаралды 72 М.
Spring Security - Lesson 29 -  Using permissions
1:04:36
Laur Spilca
Рет қаралды 2,2 М.
A super easy start to understanding Spring Security!
43:44
Laur Spilca
Рет қаралды 10 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН