for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class CreatorOnlyCanEditExtension extends Extension
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
/*
Only allow editing when the current user is the same as the creator for each of cycling route, cycling exploration and cycling short
*/
public function canEdit($member = null)
$member
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
//return in_array($this->owner->ClassName, array('RideFolder','Ride','CyclingShort','CyclingRoute','CyclingExploration'));
$caneditasowner = true;
if (in_array($this->owner->ClassName, array('CyclingShort', 'CyclingRoute', 'CyclingExploration'))) {
if ($this->owner->CreatorID != Member::currentUserID()) {
$caneditasowner = false;
}
return (Permission::check('ADMIN')) || $caneditasowner;
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.