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

  • SEARCH
  • Home
  • 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 8162403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:41:58+00:00 2026-06-06T18:41:58+00:00

Can we do both Principle and as-well-as GratedAuthority in acl_sid and give permissions for

  • 0

Can we do both Principle and as-well-as GratedAuthority in acl_sid and give permissions for a object in spring acl security ?

  • 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-06-06T18:41:59+00:00Added an answer on June 6, 2026 at 6:41 pm

    Yes, we can do that. ACL_SID table can take SIDs that are either roles or users.

    Here is a sample insert when it is role:

    insert into acl_sid (principal, sid) values (false, 'ROLE_ADMIN');
    

    If it is a user principal then the insert will be:

    insert into acl_sid (principal, sid) values (true, 'bob');
    

    You can also do runtime manipulation of ACL fields using mutable ACL.

    Here is a sample:

    // Prepare the information we'd like in our access control entry (ACE)
    ObjectIdentity oi1 = new ObjectIdentityImpl(Foo.class, new Long(44));
    ObjectIdentity oi2 = new ObjectIdentityImpl(Bar.class, new Long(44));
    Sid user = new PrincipalSid("bob");
    Sid adminRole = new GrantedAuthoritySid("ROLE_ADMIN");
    Permission p1 = BasePermission.READ;
    Permission p2 = BasePermission.ADMINISTRATION;
    
    // Create or update the relevant ACL
    MutableAcl acl1 = null;
    MutableAcl acl2 = null;
    try {
      acl1 = mutableAclService.readAclById(oi1);
    } catch (NotFoundException nfe) {
      acl1 = mutableAclService.createAcl(oi1);
    }
    
    try {
      acl2 = mutableAclService.readAclById(oi2);
    } catch (NotFoundException nfe) {
      acl2 = mutableAclService.createAcl(oi2);
    }
    
    // Now grant some permissions via an access control entry (ACE)
    acl1.setOwner(user);
    acl1.insertAce(0, p1, user, true);
    aclService.updateAcl(acl1);
    acl2.setOwner(adminRole);
    acl2.insertAce(0, p2, adminRole, true);
    aclService.updateAcl(acl2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two view controllers in a tabbar which can both edit data. Therefore,
I'm writing an app where a user can both create their own pages for
From what I learned, a MySQL MASTER server is one that can both read
I can implement both variants - it's easy. But I'm interested: what approach is
It seems both can be overloaded, but somebody said not..... What's the case?
In PHP you can access both the names and values of an array in
24x7 from SoftTree Technologies can use both JAL and VBScript for scripting. Does anyone
So a FILE stream can have both input and output buffers. You can adjust
I need a function that can parse both 1,123.12 and 1.123,12 to 1123.12 There
Does anyone know how I can check if a string contains well-formed XML without

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.