Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bdbbe58

Browse filesBrowse files
committed
[Security][Acl] Issue #5787 : Added MutableAclProvider::deleteSecurityIdentity
Code style fix and documentation typo
1 parent d744ffa commit bdbbe58
Copy full SHA for bdbbe58

File tree

Expand file treeCollapse file tree

1 file changed

+27
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+27
-0
lines changed

‎src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php
+27Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,18 @@ public function deleteAcl(ObjectIdentityInterface $oid)
108108
}
109109
}
110110

111+
/**
112+
* Deletes the security identity from the database.
113+
* ACL entries have the CASCADE option on their foreign key so they will also get deleted
114+
*
115+
* @param SecurityIdentityInterface $sid
116+
* @throws \InvalidArgumentException
117+
*/
118+
public function deleteSecurityIdentity(SecurityIdentityInterface $sid)
119+
{
120+
$this->connection->executeQuery($this->getDeleteSecurityIdentityIdSql($sid));
121+
}
122+
111123
/**
112124
* {@inheritDoc}
113125
*/
@@ -595,6 +607,21 @@ protected function getSelectSecurityIdentityIdSql(SecurityIdentityInterface $sid
595607
);
596608
}
597609

610+
/**
611+
* Constructs the SQL to delete a security identity.
612+
*
613+
* @param SecurityIdentityInterface $sid
614+
* @throws \InvalidArgumentException
615+
* @return string
616+
*/
617+
protected function getDeleteSecurityIdentityIdSql(SecurityIdentityInterface $sid)
618+
{
619+
$select = $this->getSelectSecurityIdentityIdSql($sid);
620+
$delete = preg_replace('/^SELECT id FROM/', 'DELETE FROM', $select);
621+
622+
return $delete;
623+
}
624+
598625
/**
599626
* Constructs the SQL for updating an object identity.
600627
*

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.