mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Refactored [47082]: Modified Member::mapInCMSGroups to make use of CMSMain::providePermissions.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60522 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ef08421ed7
commit
78c2615821
@ -814,8 +814,18 @@ class Member extends DataObject {
|
|||||||
*/
|
*/
|
||||||
public static function mapInCMSGroups($groups = null) {
|
public static function mapInCMSGroups($groups = null) {
|
||||||
if(!$groups || $groups->Count() == 0) {
|
if(!$groups || $groups->Count() == 0) {
|
||||||
|
$perms = array('ADMIN', 'CMS_ACCESS_AssetAdmin');
|
||||||
|
|
||||||
|
$cmsPerms = singleton('CMSMain')->providePermissions();
|
||||||
|
|
||||||
|
if(!empty($cmsPerms)) {
|
||||||
|
$perms = array_unique(array_merge($perms, array_keys($cmsPerms)));
|
||||||
|
}
|
||||||
|
|
||||||
|
$SQL_perms = "'" . array_join(Convert::raw2sql($perms), "', '") . "'";
|
||||||
|
|
||||||
$groups = DataObject::get('Group', "", "",
|
$groups = DataObject::get('Group', "", "",
|
||||||
"INNER JOIN `Permission` ON `Permission`.GroupID = `Group`.ID AND `Permission`.Code IN ('ADMIN', 'CMS_ACCESS_AssetAdmin')");
|
"INNER JOIN `Permission` ON `Permission`.GroupID = `Group`.ID AND `Permission`.Code IN ($SQL_perms)");
|
||||||
}
|
}
|
||||||
|
|
||||||
$groupIDList = array();
|
$groupIDList = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user