diff --git a/app/Http/Controllers/Api/V1/SuborganizationController.php b/app/Http/Controllers/Api/V1/SuborganizationController.php index e7654ec8f..2772b341f 100644 --- a/app/Http/Controllers/Api/V1/SuborganizationController.php +++ b/app/Http/Controllers/Api/V1/SuborganizationController.php @@ -188,6 +188,9 @@ public function uploadFavicon(SuborganizationUploadFaviconRequest $suborganizati * @bodyParam msteam_secret_id uuid Secret id Example: 123e4567-e89b-12d3-a456-426614174000 * @bodyParam msteam_tenant_id uuid Tenant id Example: 123e4567-e89b-12d3-a456-426614174000 * @bodyParam msteam_secret_id_expiry date Secret expiry date Example: 2022-09-29 + * @bodyParam msteam_project_visibility bool Enable/disable google classroom Example: false + * @bodyParam msteam_playlist_visibility bool Enable/disable google classroom Example: false + * @bodyParam msteam_activity_visibility bool Enable/disable google classroom Example: false * * @responseFile 201 responses/organization/suborganization.json * @@ -275,6 +278,9 @@ public function show(Organization $suborganization) * @bodyParam msteam_secret_id uuid Secret id Example: 123e4567-e89b-12d3-a456-426614174000 * @bodyParam msteam_tenant_id uuid Tenant id Example: 123e4567-e89b-12d3-a456-426614174000 * @bodyParam msteam_secret_id_expiry date Secret expiry date Example: 2022-09-29 + * @bodyParam msteam_project_visibility bool Enable/disable google classroom Example: false + * @bodyParam msteam_playlist_visibility bool Enable/disable google classroom Example: false + * @bodyParam msteam_activity_visibility bool Enable/disable google classroom Example: false * * @responseFile responses/organization/suborganization.json * diff --git a/app/Http/Requests/V1/SuborganizationSave.php b/app/Http/Requests/V1/SuborganizationSave.php index 0f331f57e..2ca897f40 100644 --- a/app/Http/Requests/V1/SuborganizationSave.php +++ b/app/Http/Requests/V1/SuborganizationSave.php @@ -60,6 +60,9 @@ public function rules() 'msteam_secret_id' => 'uuid|nullable|max:255', 'msteam_tenant_id' => 'uuid|nullable|max:255', 'msteam_secret_id_expiry' => 'date|nullable', + 'msteam_project_visibility' => 'boolean', + 'msteam_playlist_visibility' => 'boolean', + 'msteam_activity_visibility' => 'boolean', ]; } diff --git a/app/Http/Requests/V1/SuborganizationUpdate.php b/app/Http/Requests/V1/SuborganizationUpdate.php index 334017d27..e7a08bbfa 100644 --- a/app/Http/Requests/V1/SuborganizationUpdate.php +++ b/app/Http/Requests/V1/SuborganizationUpdate.php @@ -68,6 +68,9 @@ public function rules() 'msteam_secret_id' => 'uuid|nullable|max:255', 'msteam_tenant_id' => 'uuid|nullable|max:255', 'msteam_secret_id_expiry' => 'date|nullable', + 'msteam_project_visibility' => 'boolean', + 'msteam_playlist_visibility' => 'boolean', + 'msteam_activity_visibility' => 'boolean', ]; } diff --git a/app/Http/Resources/V1/OrganizationResource.php b/app/Http/Resources/V1/OrganizationResource.php index 4c8afe433..4c44da542 100644 --- a/app/Http/Resources/V1/OrganizationResource.php +++ b/app/Http/Resources/V1/OrganizationResource.php @@ -97,7 +97,10 @@ public function toArray($request) 'msteam_client_id' => $this->msteam_client_id, 'msteam_secret_id' => $this->msteam_secret_id, 'msteam_tenant_id' => $this->msteam_tenant_id, - 'msteam_secret_id_expiry' => $this->msteam_secret_id_expiry + 'msteam_secret_id_expiry' => $this->msteam_secret_id_expiry, + 'msteam_project_visibility' => $this->gcr_project_visibility, + 'msteam_playlist_visibility' => $this->gcr_playlist_visibility, + 'msteam_activity_visibility' => $this->gcr_activity_visibility ]; } } diff --git a/database/migrations/2022_09_29_112914_add_ms_team_visibility_fields_to_organizations_table.php b/database/migrations/2022_09_29_112914_add_ms_team_visibility_fields_to_organizations_table.php new file mode 100644 index 000000000..bf11a982b --- /dev/null +++ b/database/migrations/2022_09_29_112914_add_ms_team_visibility_fields_to_organizations_table.php @@ -0,0 +1,34 @@ +boolean('msteam_project_visibility')->nullable()->default(true); + $table->boolean('msteam_playlist_visibility')->nullable()->default(false); + $table->boolean('msteam_activity_visibility')->nullable()->default(false); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('organizations', function (Blueprint $table) { + $table->dropColumn(['msteam_project_visibility', 'msteam_playlist_visibility', 'msteam_activity_visibility']); + }); + } +} diff --git a/storage/responses/organization/suborganization.json b/storage/responses/organization/suborganization.json index 5ed0da312..92441fc10 100644 --- a/storage/responses/organization/suborganization.json +++ b/storage/responses/organization/suborganization.json @@ -50,6 +50,9 @@ "msteam_client_id" : null, "msteam_secret_id" : null, "msteam_tenant_id" : null, - "msteam_secret_id_expiry": null + "msteam_secret_id_expiry": null, + "msteam_project_visibility": true, + "msteam_playlist_visibility": false, + "msteam_activity_visibility": false } }