Git Product home page Git Product logo

Comments (4)

aborjesson-zz avatar aborjesson-zz commented on August 19, 2024

I have the same problem. Any new on this?

from mongodbaclbundle.

iampersistent avatar iampersistent commented on August 19, 2024

Unfortunately, I haven't looked into this yet.

from mongodbaclbundle.

aborjesson-zz avatar aborjesson-zz commented on August 19, 2024

I did look in to this. if instead of:
$acl->insertClassAce($securityIdentity, MaskBuilder::MASK_OWNER);
does $acl->insertObjectAce($securityIdentity, MaskBuilder::MASK_OWNER);
You will have the reference between acl_entry and o_id, but however the Permission Flow doesn't work. If no objectAce exists, it should normally fall back on classAce. But since we do not use classAce it will of course fail.

Why it isn't set for classAce: (MutableAclProvider)
1.
$objectIdentityId = $name === 'classAces' ? null : $ace->getAcl()->getId();
2.
$aceId = (string)$this->insertAccessControlEntry($objectIdentityId, null, $i, $sid, $ace->getStrategy(), $ace->getMask(), $ace->isGranting(), $ace->isAuditSuccess(), $ace->isAuditFailure());
3.
if (isset($objectIdentityId)) {
$criteria['objectIdentity'] = array(
'$ref' => $this->options['oid_collection'],
'$id' => new \MongoId($objectIdentityId),
);
}

The objectIdentity property will not be set in DB.

from mongodbaclbundle.

Narretz avatar Narretz commented on August 19, 2024

aborjessen pointed out one part of the problem: In updateAclProperty, no objectIdentity or other reference is set for classAces.

Later, when checking access, the AclProvider will try to get all acl_entries associated with the acl_oid in lookupObjectIdentities with this query:

$entryQuery = array('objectIdentity.$id' => array('$in' => $oids));
$entryCursor = $this->connection->selectCollection($this->options['entry_collection'])->find($entryQuery);

Now the query can obviously not get any aces that do not have an objectIdentity set.

So we need two things
a) Association of classAce with its class in the db
b) A way to query for these class Aces that doesn't have to much overhead

One option is to add a class field to the Ace (always or only if it actually is a classAce), and query for that additionally .

from mongodbaclbundle.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.