summaryrefslogtreecommitdiff
path: root/public/app/extends/Classroom_user.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-27 03:47:30 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-27 03:47:30 +0300
commit059e0d95d0c28bc5060e87e146eaf7411f51bf90 (patch)
tree7c21ac432f16dde2329a0d5954d70711eceb48e6 /public/app/extends/Classroom_user.php
parent26cd8ee99659ef1926c96a049c93645ffc9b169d (diff)
downloadgyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.tar.gz
gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.tar.bz2
gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.zip
skeleton commit; based on an anom project
Diffstat (limited to 'public/app/extends/Classroom_user.php')
-rw-r--r--public/app/extends/Classroom_user.php121
1 files changed, 121 insertions, 0 deletions
diff --git a/public/app/extends/Classroom_user.php b/public/app/extends/Classroom_user.php
new file mode 100644
index 0000000..c27c4bf
--- /dev/null
+++ b/public/app/extends/Classroom_user.php
@@ -0,0 +1,121 @@
+<?php
+namespace app\extends;
+
+use User;
+use Registry;
+
+
+/** Classroom_user
+ *
+ * extends (anom's) User
+ *
+ * this way it specializes the UserManagement
+ * according to this app's special rules
+ *
+ * Add privileges concept
+ * ---
+ * A Class_user has privileges (which are deferent than Roles)
+ * In fact, privileges extend the authorization requirements for users
+ *
+ * Authorized content is marked with some 'minimum Privilege'
+ * So the content is available to the READER(s) that have certain Privileges
+ *
+ */
+class Classroom_user extends User
+{
+
+ /** user id
+ * @var int
+ */
+ private $id;
+
+ /** user privileges
+ * @var array
+ */
+ private $privileges = [];
+
+ /** user name
+ * @var string
+ */
+ private $name;
+
+ /** SETTERS AND GETTERS
+ * for id, name, privileges attributes
+ * -------------------------------------------------------------------------
+ */
+
+ // id
+ // --- -- -- - - -
+
+ /** getID
+ * @return int
+ */
+ public function getID(): int
+ {
+ return $this->id;
+ }
+
+ /** setID()
+ *
+ * @param int : user id
+ *
+ * @return User
+ */
+ public function setID(int $id): self
+ {
+ $this->id = $id;
+ return $this;
+ }
+
+
+ // name
+ // --- -- -- - - -
+
+ /** getName
+ * @return int
+ */
+ public function getName(): string
+ {
+ return $this->name;
+ }
+
+ /** setName()
+ *
+ * @param string : user's full name
+ *
+ * @return User
+ */
+ public function setName(string $name): self
+ {
+ $this->name = $name;
+ return $this;
+ }
+
+
+ // privileges
+ // --- -- -- - - -
+
+ /** getPrivileges
+ *
+ * @return privileges (array)
+ */
+ public function getPrivileges(): array
+ {
+ return $this->privileges;
+ }
+
+
+ /** setPrivileges()
+ *
+ * @param array $privileges
+ *
+ * @return User
+ */
+ public function setPrivileges(array $privileges): self
+ {
+ $this->privileges = $privileges;
+ return $this;
+ }
+
+
+} \ No newline at end of file