Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions modules/acknowledgements/php/acknowledgementrow.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,16 @@ class AcknowledgementRow implements \LORIS\Data\DataInstance
{
return $this->DBRow;
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return true;
}
}
15 changes: 15 additions & 0 deletions modules/api/php/models/candidatesrow.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,19 @@ class CandidatesRow implements \LORIS\Data\DataInstance,
}
return $this->_projectid;
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerAndProjectMatch(
$user,
$this
);
}
}
15 changes: 15 additions & 0 deletions modules/api/php/models/projectimagesrow.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,19 @@ class ProjectImagesRow implements \LORIS\Data\DataInstance,
{
return $this->_entitytype === 'Scanner';
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerMatch(
$user,
$this
);
}
}
12 changes: 12 additions & 0 deletions modules/api/php/models/projectinstrumentsrow.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,16 @@ class ProjectInstrumentsRow implements \LORIS\Data\DataInstance
}
return $obj;
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return true;
}
}
15 changes: 15 additions & 0 deletions modules/api/php/models/projectrecordingsrow.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,19 @@ class ProjectRecordingsRow implements \LORIS\Data\DataInstance
{
return intval($this->_centerid);
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerMatch(
$user,
$this
);
}
}
15 changes: 15 additions & 0 deletions modules/api/php/models/sitesrow.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,19 @@ class SitesRow implements DataInstance, SiteHaver
{
return \CenterID::singleton($this->_id);
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerMatch(
$user,
$this
);
}
}
15 changes: 15 additions & 0 deletions modules/battery_manager/php/test.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,19 @@ class Test implements
'Active' => $this->row['active'] ?? null,
];
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerMatch(
$user,
$this
);
}
}
15 changes: 15 additions & 0 deletions modules/behavioural_qc/php/models/behaviouraldto.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,19 @@ class BehaviouralDTO implements \LORIS\Data\DataInstance,
'feedback_status' => $this->_feedback_status,
];
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerAndProjectMatch(
$user,
$this
);
}
}
15 changes: 15 additions & 0 deletions modules/behavioural_qc/php/models/conflictsdto.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,19 @@ class ConflictsDTO implements \LORIS\Data\DataInstance,
'commentID' => $this->_commentID,
];
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerAndProjectMatch(
$user,
$this
);
}
}
15 changes: 15 additions & 0 deletions modules/behavioural_qc/php/models/incompletedto.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,19 @@ class IncompleteDTO implements \LORIS\Data\DataInstance,
'commentID' => $this->_commentID,
];
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerAndProjectMatch(
$user,
$this
);
}
}
15 changes: 15 additions & 0 deletions modules/biobank/php/container.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -558,4 +558,19 @@ class Container implements
{
return json_encode($this);
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerMatch(
$user,
$this
);
}
}
16 changes: 15 additions & 1 deletion modules/biobank/php/log.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,19 @@ class Log implements \JsonSerializable, \LORIS\Data\DataInstance
{
return json_encode($this);
}
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerMatch(
$user,
$this
);
}
}
16 changes: 15 additions & 1 deletion modules/biobank/php/pool.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -497,5 +497,19 @@ class Pool implements
{
return json_encode($this);
}
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerAndProjectMatch(
$user,
$this
);
}
}
16 changes: 15 additions & 1 deletion modules/biobank/php/shipment.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,19 @@ class Shipment implements
{
return json_encode($this);
}
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerMatch(
$user,
$this
);
}
}
15 changes: 15 additions & 0 deletions modules/biobank/php/specimen.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -713,4 +713,19 @@ class Specimen implements
{
return json_encode($this);
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerAndProjectMatch(
$user,
$this
);
}
}
15 changes: 15 additions & 0 deletions modules/candidate_list/php/candidatelistrow.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,19 @@ class CandidateListRow implements \LORIS\Data\DataInstance,
{
return $this->ProjectID;
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerAndProjectMatch(
$user,
$this
);
}
}
15 changes: 15 additions & 0 deletions modules/conflict_resolver/php/models/resolveddto.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,19 @@ class ResolvedDTO implements DataInstance, SiteHaver
{
return \ProjectID::singleton($this->projectid);
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerAndProjectMatch(
$user,
$this
);
}
}
15 changes: 15 additions & 0 deletions modules/conflict_resolver/php/models/unresolveddto.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,19 @@ class UnresolvedDTO implements DataInstance, SiteHaver
{
return \ProjectID::singleton($this->projectid);
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return \LORIS\StudyEntities\DataInstanceAccess::centerAndProjectMatch(
$user,
$this
);
}
}
12 changes: 12 additions & 0 deletions modules/data_release/php/datareleaserow.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,16 @@ class DataReleaseRow implements \LORIS\Data\DataInstance
{
return $this->DBRow;
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return true;
}
}
13 changes: 13 additions & 0 deletions modules/datadict/php/datadictrow.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,17 @@ class DataDictRow implements \LORIS\Data\DataInstance
{
return $this->DBRow;
}

/**
* Check whether a user can access this data instance.
*
* @param \User $user The user whose access is being checked
*
* @return bool
*/
public function isAccessibleBy(\User $user): bool
{
return $user->hasPermission('data_dict_view')
|| $user->hasPermission('data_dict_edit');
}
}
Loading
Loading