summaryrefslogtreecommitdiff
path: root/public/app/extends/App_user.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-05-01 04:33:06 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-05-01 04:33:06 +0300
commit2b4ed611e7e001ad8ea93ef3e8cdce35bc56dc07 (patch)
tree0da2582de2cef450f6366a9cff28e47353eddb2e /public/app/extends/App_user.php
parent77b3a3ebf23598b82d035ead6df43b2c2ca885f4 (diff)
downloadgyraf1gov-2b4ed611e7e001ad8ea93ef3e8cdce35bc56dc07.tar.gz
gyraf1gov-2b4ed611e7e001ad8ea93ef3e8cdce35bc56dc07.tar.bz2
gyraf1gov-2b4ed611e7e001ad8ea93ef3e8cdce35bc56dc07.zip
form designer; setup main forms of the application
Diffstat (limited to 'public/app/extends/App_user.php')
-rw-r--r--public/app/extends/App_user.php121
1 files changed, 121 insertions, 0 deletions
diff --git a/public/app/extends/App_user.php b/public/app/extends/App_user.php
new file mode 100644
index 0000000..9aed489
--- /dev/null
+++ b/public/app/extends/App_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 App_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