-# Change log of zentrum
+# Änderungen an zentrum
+
+# V0.1.1
+- User.php: +findRole() +hasRole() +isAdmin()
+
];
}
+ /**
+ * Returns the role of the user.
+ *
+ * @return Role the role of the user
+ */
+ protected function findRole()
+ {
+ if ($this->role == null){
+ $this->role = Role::find($this->role_id);
+ }
+ return $this->role;
+ }
+ /**
+ * Tests whether the user has a role with a priority less than or equal to the given priority. The lower the priority, the more powerful the role.
+ * @param int $priority the priority to test against
+ * @return bool True if the user has a role with a priority less than or equal to the given priority, False otherwise
+ */
+ public function hasRole(int $priority): bool
+ {
+ $role = $this->findRole();
+ $rc = $this->role->priority <= $priority;
+ return $rc;
+ }
+ /**
+ * Tests whether the user is an admin.
+
+ * @return bool True if the user is an admin, False otherwise
+ */
+ public function isAdmin(): bool
+ {
+ $this->findRole();
+ $rc = $this->role->priority <= 19;
+ return $rc;
+ }
}
},
{
"name": "laravel/pint",
- "version": "v1.21.0",
+ "version": "v1.21.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/pint.git",
- "reference": "531fa0871fbde719c51b12afa3a443b8f4e4b425"
+ "reference": "c44bffbb2334e90fba560933c45948fa4a3f3e86"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/pint/zipball/531fa0871fbde719c51b12afa3a443b8f4e4b425",
- "reference": "531fa0871fbde719c51b12afa3a443b8f4e4b425",
+ "url": "https://api.github.com/repos/laravel/pint/zipball/c44bffbb2334e90fba560933c45948fa4a3f3e86",
+ "reference": "c44bffbb2334e90fba560933c45948fa4a3f3e86",
"shasum": ""
},
"require": {
"php": "^8.2.0"
},
"require-dev": {
- "friendsofphp/php-cs-fixer": "^3.68.5",
- "illuminate/view": "^11.42.0",
- "larastan/larastan": "^3.0.4",
+ "friendsofphp/php-cs-fixer": "^3.70.2",
+ "illuminate/view": "^11.44.1",
+ "larastan/larastan": "^3.1.0",
"laravel-zero/framework": "^11.36.1",
"mockery/mockery": "^1.6.12",
"nunomaduro/termwind": "^2.3",
"issues": "https://github.com/laravel/pint/issues",
"source": "https://github.com/laravel/pint"
},
- "time": "2025-02-18T03:18:57+00:00"
+ "time": "2025-03-11T03:22:21+00:00"
},
{
"name": "laravel/sail",
"All": "Alle",
"Amount": "Betrag",
"Analysis": "Analyse",
+ "Article": "Artikel",
"Assign Roles": "Rollen zuordnen",
"Back": "Zur\u00fcck",
"Body": "Info",
"Duration": "Dauer",
"Duration (minutes)": "Dauer (Minuten)",
"Email": "Email",
+ "Email has been sent if the email address is known.": "Email wurde gesendet, wenn die Emailadresse bekannt ist.",
"Email\/Phone": "Email\/Telefon",
"English (Britisch)": "Englisch (GB)",
"Exchange of a File": "Austausch einer Datei",
"Files": "Dateien",
"Filtered": "Gefiltert",
"Firstname": "Vorname",
+ "Forgotten Password?": "Passwort vergessen?",
"French (France)": "Franz\u00f6sisch (Frankreich)",
"Fri": "Fr",
"From": "Von",