public function beforeFilter(\Cake\Event\Event $event)
{
parent::beforeFilter($event);
- $this->Auth->allow(['index', 'view','lastAdded',"getProjectsById"]);
+ $this->Auth->allow(['index',
+ 'view',
+ 'lastAdded',
+ "getProjectsById",
+ 'contributorsSoftware',
+ 'usersSoftware',
+ 'reviewsSoftware',
+ "backersSoftware",
+ "servicesProviders",
+ "workswellSoftwares",
+ "screenshots"
+ ]);
// $this->Auth->deny('edit');
}
}
/**
- * Get all contributors for a software
+ * Get all alternative for a software
* @param integer $id
*/
- public function contributorsSoftware ($id=null){
-
+ public function alternativeTo ($id=null) {
$software = $this->Softwares->get($id,
["contain" =>
[
- 'Contributorssoftwares'=> [
+ 'alternativeto'=> [
'strategy' => 'select',
'queryBuilder' => function ($q) {
- return $q->order(['Users.username' =>'ASC']);
+ return $q->order(['Softwares.softwarename' =>'ASC']);
},
- 'Users' => [
- 'UserTypes',
+ 'Softwares' => [
'fields' => [
'id',
- 'username',
+ 'softwarename',
'logo_directory',
'photo',
'description'
}
/**
- * Get all alternative for a software
+ * Get all contributors for a software
* @param integer $id
*/
- public function alternativeTo ($id=null) {
+ public function contributorsSoftware ($id=null){
+
$software = $this->Softwares->get($id,
["contain" =>
[
- 'alternativeto'=> [
+ 'Contributorssoftwares'=> [
'strategy' => 'select',
'queryBuilder' => function ($q) {
- return $q->order(['Softwares.softwarename' =>'ASC']);
+ return $q->order(['Users.username' =>'ASC']);
},
- 'Softwares' => [
+ 'Users' => [
+ 'UserTypes',
'fields' => [
'id',
- 'softwarename',
+ 'username',
'logo_directory',
'photo',
'description'