5 include_once(
"./Modules/Exercise/RepoObjectAssignment/interfaces/interface.ilExcRepoObjAssignmentAccessInfoInterface.php");
39 protected function __construct($a_is_granted, array $a_not_granted_reasons)
43 $this->access = $DIC->access();
44 $this->is_granted = $a_is_granted;
45 $this->not_granted_reasons = $a_not_granted_reasons;
47 $this->lng = $DIC->language();
78 public static function getInfo($a_ref_id, $a_user_id)
82 include_once(
"./Modules/Exercise/RepoObjectAssignment/classes/class.ilExcRepoObjAssignment.php");
84 $lng = $DIC->language();
88 $assignment_info = $repo_obj_ass->getAssignmentInfoOfObj($a_ref_id, $a_user_id);
89 if (count($assignment_info) == 0) {
90 return new self(
true, []);
95 foreach ($assignment_info as
$i) {
96 if (!$i->isUserSubmission()) {
97 $has_write_permission =
false;
98 foreach ($i->getReadableRefIds() as $exc_ref_id) {
99 if (
$access->checkAccessOfUser($a_user_id,
"write",
"", $exc_ref_id)) {
100 $has_write_permission =
true;
103 if (!$has_write_permission) {
105 $reasons[0] =
$lng->txt(
"exc_obj_not_submitted_by_user");
110 return new self($granted, $reasons);
static getInfo($a_ref_id, $a_user_id)
getNotGrantedReasons()
Get reasons why access is not granted.
static getInstance()
Get instance.
__construct($a_is_granted, array $a_not_granted_reasons)
Constructor.
isGranted()
Is access granted due to exercise assignment conditions?
Interface for assignment types.
Repository object assignment information.