Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6713997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:26:41+00:00 2026-05-26T08:26:41+00:00

How much custom implementation is wise when it comes to spring security? How optimized

  • 0

How much custom implementation is wise when it comes to spring security? How optimized is it or what parts are optimized the most and where should one not custom implement unless absolutely neccessary?

I’m wondering this as I am thinking of a way to implement dynamic ACLs that grant or revoke principal access for a single object as well as all objects of that type or even any String identifier. If i want to be able to say

@PreAuthorize("hasPermission(#person, details)")
public void getDetailsForPerson(Person person)

as well as

@PreAuthorize("hasPermission('package.path.Person', read)") 
public void getAllPersons()

as well as

@PreAuthorize("hasPermission('Person', read)") 
public void getAllPersons()

as well as

@PreAuthorize("hasPermission(#id, 'package.path.Person', read)")
public void getOnePerson(int id)

I will have to implement PermissionEvaluator. Now while I’m at it, why whould I use the exact spring-security ACL datamodel (as documented in the Spring Security Reference Appendix A.3 ) instead of implementing my own? I’ll have to implement my own ACLService anyway if I want to allow permission evaluation for object types or strings as well as instances of objects.

Same for the ObjectIdentity Lookups: I’ll have to implement those myself as well as I want to generate a OID from an @Entitys serialVersionUID to be able to grant access to a type permissions.

So as I am thinking of more and more things to custom implement, I am wondering, if I am still on the right track. Looking at tutorials like the Denksoft blog. I feel like I am missing out on a lot of spring-security’s capabilities we might need later on. Or is it just that spring-security is very powerful and complex in case you need it but if you want to, you can do most of it yourself and just use the general framework to hold it all together?

Or am I creating potential security holes by not sticking to the tested implementations? Is what I have in mind already dangerous or still acceptable from a security and software design standpoint since I stick to the interfaces provided by spring-security? I haven’t customized too many given implementations yet…

So… Thoughts on what we are planning to do (permissions for types as well as objects) as well as customizing spring-security would be very welcome.

Cheers!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:26:42+00:00Added an answer on May 26, 2026 at 8:26 am

    Hm, no one seems to want to share their experience, thoughts or tips concerning the customization of spring security here, so I’ll mark this as answered.

    In short what we ended up doing was to custom-implement all spring security interfaces that interact with the database to use our own JPA/Hibernate access stack. That meant implementing

    Authentication:

    • CustomerDetailsService to handle our account table
    • RoleHierarchy to resolve our own hierarchy table (1:n relation to Role which has a m:n to Account)
    • PersistentLoginToken to persist the remember-me token inside our DB

    For our special Access Control List that also supports setting permissions for all objects of a type:

    • MutableAclService, Acl, AccessControlEntry and LookupStrategy to build the ACLs
    • PermissionEvaluator to support class type (as String) arguments

    So all in all quite a bit of work and there are still some things our implementation lacks. Was it worth it? Certainly, as we now have a lot more control, more flexibility and new features. Is it stable? We shall see, 45 unit tests so far for the custom implementations sounds like much but it really isn’t.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have not worked with parameters in ADO.Net very much. I'm writing a custom
How much should one DataSet represent? Using the example of an ordering system: While
This is a custom encryption library. I do not know much about PHP's standard
I'd like to add custom controls to the mediaPlayer control view much as this
I am not sure whether it is possible to achieve this kind of implementation
I have an issue with creating my User Roles in a custom authorisation implementation.
I have a custom implementation of the Map interface which does some fancy stuff,
I'm working on moving as much logic out of a custom control as possible
Rather than implementing a clunky, potentially bug-ridden custom table, I went with the much
I wrote a custom XML reader because I needed something that would not read

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.