diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-17 12:12:22 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-17 12:12:22 +0300 |
| commit | 68fc9e55e538e03f94509731ab41a0c8cf96710f (patch) | |
| tree | 3edb1e81864ac3eb35ba0fe8087ed24da1b812bf /public/app/extends/Classroom_user.php | |
| parent | 84b2da85a1b452922dadb6a609533b9945afe51d (diff) | |
| download | classroom-68fc9e55e538e03f94509731ab41a0c8cf96710f.tar.gz classroom-68fc9e55e538e03f94509731ab41a0c8cf96710f.tar.bz2 classroom-68fc9e55e538e03f94509731ab41a0c8cf96710f.zip | |
setup a real server environment (apache DocumentRoot=/var/www/public)
Diffstat (limited to 'public/app/extends/Classroom_user.php')
| -rw-r--r-- | public/app/extends/Classroom_user.php | 88 |
1 files changed, 88 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..1c26e73 --- /dev/null +++ b/public/app/extends/Classroom_user.php @@ -0,0 +1,88 @@ +<?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 = []; + + + /** SETTERS AND GETTERS + * for id and privileges attributes + * ------------------------------------------------------------------------- + */ + + /** 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; + } + + + + /** 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 |
