mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Merge branch '1.4' into 1
This commit is contained in:
commit
d6d6059576
@ -17,7 +17,7 @@ matrix:
|
|||||||
- php: 5.3
|
- php: 5.3
|
||||||
env: DB=PGSQL CORE_RELEASE=3.4
|
env: DB=PGSQL CORE_RELEASE=3.4
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: DB=MYSQL CORE_RELEASE=3
|
env: DB=MYSQL CORE_RELEASE=3.7
|
||||||
- php: 5.4
|
- php: 5.4
|
||||||
env: DB=MYSQL CORE_RELEASE=3.6
|
env: DB=MYSQL CORE_RELEASE=3.6
|
||||||
- php: 7.1
|
- php: 7.1
|
||||||
|
@ -183,11 +183,16 @@ class LeftAndMainSubsites extends Extension
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the current controller is accessible for this user on this subsite.
|
* Check if the current controller is accessible for this user on this subsite.
|
||||||
|
*
|
||||||
|
* @param Member $member
|
||||||
*/
|
*/
|
||||||
public function canAccess()
|
public function canAccess(Member $member = null)
|
||||||
{
|
{
|
||||||
|
if (!$member) {
|
||||||
|
$member = Member::currentUser();
|
||||||
|
}
|
||||||
|
|
||||||
// Admin can access everything, no point in checking.
|
// Admin can access everything, no point in checking.
|
||||||
$member = Member::currentUser();
|
|
||||||
if ($member &&
|
if ($member &&
|
||||||
(
|
(
|
||||||
Permission::checkMember($member, 'ADMIN') || // 'Full administrative rights' in SecurityAdmin
|
Permission::checkMember($member, 'ADMIN') || // 'Full administrative rights' in SecurityAdmin
|
||||||
@ -209,10 +214,12 @@ class LeftAndMainSubsites extends Extension
|
|||||||
/**
|
/**
|
||||||
* Prevent accessing disallowed resources. This happens after onBeforeInit has executed,
|
* Prevent accessing disallowed resources. This happens after onBeforeInit has executed,
|
||||||
* so all redirections should've already taken place.
|
* so all redirections should've already taken place.
|
||||||
|
*
|
||||||
|
* @param Member $member
|
||||||
*/
|
*/
|
||||||
public function alternateAccessCheck()
|
public function alternateAccessCheck(Member $member = null)
|
||||||
{
|
{
|
||||||
return $this->owner->canAccess();
|
return $this->owner->canAccess($member);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user