René's URL Explorer Experiment


Title: AclManager RetrievalStrategy is wrong (I think) · Issue #35 · Problematic/ProblematicAclManagerBundle · GitHub

Open Graph Title: AclManager RetrievalStrategy is wrong (I think) · Issue #35 · Problematic/ProblematicAclManagerBundle

X Title: AclManager RetrievalStrategy is wrong (I think) · Issue #35 · Problematic/ProblematicAclManagerBundle

Description: Hey, About this function : /** * @param mixed $domainObject * @param string $field * @param int $mask * @param UserInterface | TokenInterface | RoleInterface $securityIdentity * @param string $type * @param string $field * @param boolean...

Open Graph Description: Hey, About this function : /** * @param mixed $domainObject * @param string $field * @param int $mask * @param UserInterface | TokenInterface | RoleInterface $securityIdentity * @param string $type...

X Description: Hey, About this function : /** * @param mixed $domainObject * @param string $field * @param int $mask * @param UserInterface | TokenInterface | RoleInterface $securityIdentity * @param string $type...

Opengraph URL: https://github.com/Problematic/ProblematicAclManagerBundle/issues/35

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AclManager RetrievalStrategy is wrong (I think)","articleBody":"Hey, \n\nAbout this function : \n\n``` php\n    /**\n     * @param mixed $domainObject\n     * @param string $field\n     * @param int   $mask\n     * @param UserInterface | TokenInterface | RoleInterface $securityIdentity\n     * @param string $type\n     * @param string $field\n     * @param boolean $replace_existing\n     * @return \\Problematic\\AclManagerBundle\\Domain\\AbstractAclManager\n     */\n    protected function addPermission($domainObject, $field, $mask, $securityIdentity = null, $type = 'object', $replace_existing = false)\n    {\n        if(is_null($securityIdentity)){\n            $securityIdentity = $this-\u003egetUser();\n        }\n        $context = $this-\u003edoCreatePermissionContext($type, $field, $securityIdentity, $mask);\n        $oid = $this-\u003egetObjectIdentityRetrievalStrategy()-\u003egetObjectIdentity($domainObject);\n        $acl = $this-\u003edoLoadAcl($oid);\n        $this-\u003edoApplyPermission($acl, $context, $replace_existing);\n\n        $this-\u003egetAclProvider()-\u003eupdateAcl($acl);\n\n        return $this;\n    }\n```\n\nWhen you enter in her via this function :\n\n``` php\n    /**\n     * {@inheritDoc}\n     */\n    public function addClassPermission($domainObject, $mask, $securityIdentity = null)\n    {\n        $this-\u003eaddPermission($domainObject, null, $mask, $securityIdentity, 'class', false);\n    }\n```\n\nThe following line is wrong : `$oid = $this-\u003egetObjectIdentityRetrievalStrategy()-\u003egetObjectIdentity($domainObject);` in the way that use the wrong service (in `addPermission`function)\n\nBy default SecurityComponent provide this service `security.acl.object_identity_retrieval_strategy` but he can be apply only for `DomainObject` not for `Object`. And in case of call `AddClassPermission` or `serClassPermission` you didn't work with `DomainObject` but with `Object`.\n\nHere the code of `ObjectIdentityRetrievalStrategy` provided by default : \n\n``` php\n    /**\n     * {@inheritdoc}\n     */\n    public function getObjectIdentity($domainObject)\n    {\n        try {\n            return ObjectIdentity::fromDomainObject($domainObject);\n        } catch (InvalidDomainObjectException $failed) {\n            return;\n        }\n    }\n```\n\nSo when add class permission like :  `$aclManager-\u003eaddClassPermission(Media::CLASS, MaskBuilder::MASK_OPERATOR, $sid);` That trigger `InvalidDomainObjectException` and do nothing.\n\nSo, may i'm wrong ? or you must create your own `ObjectIdentityRetrievalStrategy` service to fix it ? (or dont call `ObjectIdentityRetrievalStrategy`in case of `Object`\n\nSo in my project I made a quick fix, to create my own service ObjectIdentityRetrievalStrategy, it's only for my need so to make it proper we must implement some setter, to configure identifier, but I only use `class` for this moment.\n\n``` php\nclass ObjectIdentityRetrievalStrategy extends \\Symfony\\Component\\Security\\Acl\\Domain\\ObjectIdentityRetrievalStrategy\n{\n    /**\n     * @param object $domainObject\n     *\n     * @return ObjectIdentityInterface|void\n     */\n    public function getObjectIdentity($domainObject)\n    {\n        if(is_string($domainObject)){\n            return new ObjectIdentity('class', $domainObject);\n        }\n\n        return parent::getObjectIdentity($domainObject);\n    }\n} \n```\n\nNOTE: On your example you show this : `$aclManager-\u003eaddClassPermission($comment, MaskBuilder::MASK_OWNER, $userEntity);` But when we work with `Object` the right call is  `$aclManager-\u003eaddClassPermission(Comment::CLASS, MaskBuilder::MASK_OWNER, $userEntity);` because it's not a `DomainObject` We want add the permission of all instance of $comment, not specially $comment.\n","author":{"url":"https://github.com/jjsaunier","@type":"Person","name":"jjsaunier"},"datePublished":"2014-10-14T09:51:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/35/ProblematicAclManagerBundle/issues/35"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:bf9c1f9a-d61c-479a-3c55-ff397d465ed5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB450:1D772C:2766AC0:33F9312:696B2765
html-safe-noncee5d61d2c7ee60f1ca380c7b29e3a8d20748affabe82c9f645a801476cb4181c5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDUwOjFENzcyQzoyNzY2QUMwOjMzRjkzMTI6Njk2QjI3NjUiLCJ2aXNpdG9yX2lkIjoiNjg1MDgyNDU0OTQ2NTUzMjI2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf333f456bdf66d4adb076d599033fcd08c7dc5db2d8c7fd8a3305a37bba1f9fc
hovercard-subject-tagissue:45731463
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Problematic/ProblematicAclManagerBundle/35/issue_layout
twitter:imagehttps://opengraph.githubassets.com/98e3bb6ca72df0d4231c4a8b9f3827e4f3f3e81fa74457663b0c2e05fabe521c/Problematic/ProblematicAclManagerBundle/issues/35
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/98e3bb6ca72df0d4231c4a8b9f3827e4f3f3e81fa74457663b0c2e05fabe521c/Problematic/ProblematicAclManagerBundle/issues/35
og:image:altHey, About this function : /** * @param mixed $domainObject * @param string $field * @param int $mask * @param UserInterface | TokenInterface | RoleInterface $securityIdentity * @param string $type...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejjsaunier
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
go-importgithub.com/Problematic/ProblematicAclManagerBundle git https://github.com/Problematic/ProblematicAclManagerBundle.git
octolytics-dimension-user_id744424
octolytics-dimension-user_loginProblematic
octolytics-dimension-repository_id1740896
octolytics-dimension-repository_nwoProblematic/ProblematicAclManagerBundle
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1740896
octolytics-dimension-repository_network_root_nwoProblematic/ProblematicAclManagerBundle
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/Problematic/ProblematicAclManagerBundle/issues/35#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FProblematic%2FProblematicAclManagerBundle%2Fissues%2F35
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FProblematic%2FProblematicAclManagerBundle%2Fissues%2F35
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=Problematic%2FProblematicAclManagerBundle
Reloadhttps://github.com/Problematic/ProblematicAclManagerBundle/issues/35
Reloadhttps://github.com/Problematic/ProblematicAclManagerBundle/issues/35
Reloadhttps://github.com/Problematic/ProblematicAclManagerBundle/issues/35
Problematic https://github.com/Problematic
ProblematicAclManagerBundlehttps://github.com/Problematic/ProblematicAclManagerBundle
Notifications https://github.com/login?return_to=%2FProblematic%2FProblematicAclManagerBundle
Fork 32 https://github.com/login?return_to=%2FProblematic%2FProblematicAclManagerBundle
Star 107 https://github.com/login?return_to=%2FProblematic%2FProblematicAclManagerBundle
Code https://github.com/Problematic/ProblematicAclManagerBundle
Issues 13 https://github.com/Problematic/ProblematicAclManagerBundle/issues
Pull requests 0 https://github.com/Problematic/ProblematicAclManagerBundle/pulls
Actions https://github.com/Problematic/ProblematicAclManagerBundle/actions
Projects 0 https://github.com/Problematic/ProblematicAclManagerBundle/projects
Wiki https://github.com/Problematic/ProblematicAclManagerBundle/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/Problematic/ProblematicAclManagerBundle/security
Please reload this pagehttps://github.com/Problematic/ProblematicAclManagerBundle/issues/35
Insights https://github.com/Problematic/ProblematicAclManagerBundle/pulse
Code https://github.com/Problematic/ProblematicAclManagerBundle
Issues https://github.com/Problematic/ProblematicAclManagerBundle/issues
Pull requests https://github.com/Problematic/ProblematicAclManagerBundle/pulls
Actions https://github.com/Problematic/ProblematicAclManagerBundle/actions
Projects https://github.com/Problematic/ProblematicAclManagerBundle/projects
Wiki https://github.com/Problematic/ProblematicAclManagerBundle/wiki
Security https://github.com/Problematic/ProblematicAclManagerBundle/security
Insights https://github.com/Problematic/ProblematicAclManagerBundle/pulse
AclManager RetrievalStrategy is wrong (I think)https://github.com/Problematic/ProblematicAclManagerBundle/issues/35#top
https://github.com/jjsaunier
https://github.com/jjsaunier
jjsaunierhttps://github.com/jjsaunier
on Oct 14, 2014https://github.com/Problematic/ProblematicAclManagerBundle/issues/35#issue-45731463
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.