2525 */
2626class InstancesPresenter extends BasePresenter
2727{
28-
2928 /**
3029 * @var Instances
3130 * @inject
@@ -94,7 +93,9 @@ function (Instance $instance) {
9493 return $ instance ->isAllowed ();
9594 }
9695 );
97- $ this ->sendSuccessResponse ($ this ->instanceViewFactory ->getInstances ($ instances ));
96+ $ this ->sendSuccessResponse (
97+ $ this ->instanceViewFactory ->getInstances ($ instances , $ this ->getCurrentUserOrNull ())
98+ );
9899 }
99100
100101 public function checkCreateInstance ()
@@ -109,7 +110,8 @@ public function checkCreateInstance()
109110 * @POST
110111 * @Param(type="post", name="name", validation="string:2..", description="Name of the instance")
111112 * @Param(type="post", name="description", required=false, description="Description of the instance")
112- * @Param(type="post", name="isOpen", validation="bool", description="Should the instance be open for registration?")
113+ * @Param(type="post", name="isOpen", validation="bool",
114+ * description="Should the instance be open for registration?")
113115 * @throws ForbiddenRequestException
114116 */
115117 public function actionCreateInstance ()
@@ -129,7 +131,7 @@ public function actionCreateInstance()
129131 $ this ->instances ->persist ($ instance ->getRootGroup (), false );
130132 $ this ->instances ->persist ($ localizedRootGroup , false );
131133 $ this ->instances ->persist ($ instance );
132- $ this ->sendSuccessResponse ($ this ->instanceViewFactory ->getInstance ($ instance ), IResponse::S201_CREATED );
134+ $ this ->sendSuccessResponse ($ this ->instanceViewFactory ->getInstance ($ instance, $ user ), IResponse::S201_CREATED );
133135 }
134136
135137 public function checkUpdateInstance (string $ id )
@@ -144,7 +146,8 @@ public function checkUpdateInstance(string $id)
144146 /**
145147 * Update an instance
146148 * @POST
147- * @Param(type="post", name="isOpen", validation="bool", required=false, description="Should the instance be open for registration?")
149+ * @Param(type="post", name="isOpen", validation="bool", required=false,
150+ * description="Should the instance be open for registration?")
148151 * @param string $id An identifier of the updated instance
149152 */
150153 public function actionUpdateInstance (string $ id )
@@ -159,7 +162,7 @@ public function actionUpdateInstance(string $id)
159162
160163 $ instance ->setIsOpen ($ isOpen );
161164 $ this ->instances ->persist ($ instance );
162- $ this ->sendSuccessResponse ($ this ->instanceViewFactory ->getInstance ($ instance ));
165+ $ this ->sendSuccessResponse ($ this ->instanceViewFactory ->getInstance ($ instance, $ this -> getCurrentUser () ));
163166 }
164167
165168 public function checkDeleteInstance (string $ id )
@@ -208,7 +211,7 @@ public function checkDetail(string $id)
208211 public function actionDetail (string $ id )
209212 {
210213 $ instance = $ this ->instances ->findOrThrow ($ id );
211- $ this ->sendSuccessResponse ($ this ->instanceViewFactory ->getInstance ($ instance ));
214+ $ this ->sendSuccessResponse ($ this ->instanceViewFactory ->getInstance ($ instance, $ this -> getCurrentUser () ));
212215 }
213216
214217 public function checkLicences (string $ id )
@@ -268,9 +271,12 @@ public function checkUpdateLicence(string $licenceId)
268271 /**
269272 * Update an existing license for an instance
270273 * @POST
271- * @Param(type="post", name="note", validation="string:2..255", required=false, description="A note for users or administrators")
272- * @Param(type="post", name="validUntil", validation="string", required=false, description="Expiration date of the license")
273- * @Param(type="post", name="isValid", validation="bool", required=false, description="Administrator switch to toggle licence validity")
274+ * @Param(type="post", name="note", validation="string:2..255", required=false,
275+ * description="A note for users or administrators")
276+ * @Param(type="post", name="validUntil", validation="string", required=false,
277+ * description="Expiration date of the license")
278+ * @Param(type="post", name="isValid", validation="bool", required=false,
279+ * description="Administrator switch to toggle licence validity")
274280 * @param string $licenceId Identifier of the licence
275281 * @throws NotFoundException
276282 */
0 commit comments