FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Permissions.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2023 Divij Sharma <divijs75@gmail.com>
4  SPDX-License-Identifier: GPL-2.0-only
5 */
10 namespace Fossology\UI\Api\Models;
11 
12 
14 {
19  private $publicPerm;
24  private $permGroups;
30  {
31  $this->publicPerm = $publicPerm;
32  $this->permGroups = $permGroups;
33  }
34 
38  public function getpublicPerm()
39  {
40  return $this->publicPerm;
41  }
42 
46  public function getpermGroups()
47  {
48  return $this->permGroups;
49  }
50 
56  public function getJSON($version=ApiVersion::V1)
57  {
58  return json_encode($this->getArray($version));
59  }
60 
66  public function getArray($version=ApiVersion::V1)
67  {
68  if ($version == ApiVersion::V2) {
69  return [
70  'publicPerm' => $this->getpublicPerm(),
71  'permGroups' => $this->getpermGroups(),
72  ];
73  }
74  return [
75  'publicPerm' => $this->getpublicPerm(),
76  'permGroups' => $this->getpermGroups(),
77  ];
78  }
79 
83  public function setpublicPerm($publicPerm)
84  {
85  $this->publicPerm= $publicPerm;
86  }
87 
91  public function setpermGroups($permGroups)
92  {
93  $this->permGroups = $permGroups;
94  }
95 }
getArray($version=ApiVersion::V1)
Definition: Permissions.php:66
__construct($publicPerm, $permGroups)
Definition: Permissions.php:29
getJSON($version=ApiVersion::V1)
Definition: Permissions.php:56