diff --git a/README.md b/README.md
index 58d1ce4..880ba02 100644
--- a/README.md
+++ b/README.md
@@ -1,27 +1,36 @@
# Szakdolgozat
+Egy webalkalmazás, amely nyomonköveti egy-egy kurzus követelményeinek teljesitését oktatók és hallgatók számára.
-This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.0.2.
+## Szerepkörök
+Csak bejelentkezett felhasználók férhetnek hozzá bármilyen adathoz. A saját adataikat mindig tudják módositani.
-## Development server
+### Admin
+* Teljes jogosultsága van az adatokhoz, kivéve a felhasználók adatait
+* Hozzá tud rendelni más felhasználókat szerepkörökhöz egy-egy kurzus kapcsán
-Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
+### Hallgató
+* Az adott kurzushoz tartozó adatokat csak megtekinteni tudja
-## Code scaffolding
+### Oktató
+* Az adott kurzushoz tartozó összes adatot tudja módositani, kivéve a nevet, azonositót.
-Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
+## Adatok
+### Kurzus
+* Azonositó
+* Név
+* Leirás
+* Követelmények
+* Eredmények
+* Oktatók
+* Hallgatók
-## Build
+### Követelmény
+* ...
-Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
+### Eredmény
+* ...
-## Running unit tests
-
-Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
-
-## Running end-to-end tests
-
-Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
-
-## Further help
-
-To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
+### Felhasználó
+* Azonositó
+* E-mail, jelszó (külön tárolva)
+* Admin-e
diff --git a/firestore.rules b/firestore.rules
index 7e6c70c..e994b4b 100644
--- a/firestore.rules
+++ b/firestore.rules
@@ -1,9 +1,24 @@
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
- match /{document=**} {
- allow read, write: if
- request.time < timestamp.date(2021, 1, 10);
+ function sameUser(user) {
+ return request.auth != null && request.auth.uid == user;
+ }
+ function getUserData() {
+ return get(/databases/$(database)/documents/users/$(request.auth.uid)).data;
+ }
+ //Felhasználói adatok kezelése
+ match /users/{user} {
+ allow create: if sameUser(user) && request.auth.uid == request.resource.data.author_uid;
+ allow get, list, update, delete: if sameUser(user) && request.auth.uid == resource.data.author_uid;
+ }
+ //Adminoknak mindent lehet
+ match /data/{document=**} {
+ allow get, list, create, update, delete: if getUserData().isAdmin == true;
+ }
+ //Diákok megnézhetik a kurzus adatait
+ match /data/courses/{course} {
+ allow get, list: if request.auth.uid in resource.data.students;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/app/app.component.html b/src/app/app.component.html
index 3e40aa2..97b8050 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -14,7 +14,7 @@
Szakdolgozat
- Regisztráció
-
- Bejelentkezés
- login
-
+
+ Kijelentkezés
+
+
+ Regisztráció
+
+ Bejelentkezés
+ login
+
+