File tree Expand file tree Collapse file tree 3 files changed +6
-11
lines changed Expand file tree Collapse file tree 3 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -82,8 +82,7 @@ service cloud.firestore {
82
82
83
83
// Users
84
84
match / users/ {userId } {
85
- allow get : if isSignedIn () && ( isSignedInWithUser (userId ) || (hasRole (' admin' ) || hasPermission (' USER_MANAGEMENT' )));
86
- allow list : if isSignedIn () && (hasRole (' admin' ) || hasPermission (' USER_MANAGEMENT' ));
85
+ allow read : if isSignedIn () && ( isSignedInWithUser (userId ) || (hasRole (' admin' ) || hasPermission (' USER_MANAGEMENT' )));
87
86
allow write : if isSignedIn () && (hasRole (' admin' ) || hasPermission (' USER_MANAGEMENT' ));
88
87
}
89
88
Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ export class UsersComponent implements OnInit {
49
49
. pipe ( takeUntilDestroyed ( this . destroyRef ) )
50
50
. subscribe ( {
51
51
next : users => {
52
- console . log ( users ) ;
53
52
this . dataSource . data = users ;
54
53
this . dataSource . filterPredicate = this . userFilterPredicate ;
55
54
this . dataSource . sort = this . sort ( ) ;
@@ -86,11 +85,9 @@ export class UsersComponent implements OnInit {
86
85
. subscribe ( {
87
86
next : ( ) => {
88
87
this . notificationService . success ( 'User has been invited.' ) ;
89
- this . loadData ( ) ;
90
88
} ,
91
89
error : ( ) => {
92
90
this . notificationService . error ( 'User can not be invited.' ) ;
93
- this . loadData ( ) ;
94
91
} ,
95
92
} ) ;
96
93
}
@@ -113,11 +110,10 @@ export class UsersComponent implements OnInit {
113
110
. subscribe ( {
114
111
next : ( ) => {
115
112
this . notificationService . success ( 'User has been updated.' ) ;
116
- this . loadData ( ) ;
117
113
} ,
118
- error : ( ) => {
114
+ error : ( error ) => {
119
115
this . notificationService . error ( 'User can not be updated.' ) ;
120
- this . loadData ( ) ;
116
+ console . error ( error ) ;
121
117
} ,
122
118
} ) ;
123
119
}
@@ -138,11 +134,9 @@ export class UsersComponent implements OnInit {
138
134
. subscribe ( {
139
135
next : ( ) => {
140
136
this . notificationService . success ( `User '${ element . email } ' has been deleted.` ) ;
141
- this . loadData ( ) ;
142
137
} ,
143
138
error : ( ) => {
144
139
this . notificationService . error ( `User '${ element . email } ' can not be deleted.` ) ;
145
- this . loadData ( ) ;
146
140
} ,
147
141
} ) ;
148
142
}
Original file line number Diff line number Diff line change @@ -39,19 +39,21 @@ export class UserService {
39
39
}
40
40
41
41
update ( id : string , model : UserUpdate ) : Observable < void > {
42
+ console . log ( 'UserService:update' , id , model ) ;
42
43
const update : UpdateData < User > = {
43
44
updatedAt : serverTimestamp ( ) ,
44
45
} ;
45
46
switch ( model . role ) {
46
47
case 'admin' : {
47
48
update . role = model . role ;
48
49
update . permissions = deleteField ( ) ;
50
+ update . lock = deleteField ( ) ;
49
51
break ;
50
52
}
51
53
case 'custom' : {
52
54
update . role = model . role ;
53
55
update . permissions = model . permissions ;
54
- update . lock = model . lock ;
56
+ update . lock = model . lock || false ;
55
57
break ;
56
58
}
57
59
case undefined : {
You can’t perform that action at this time.
0 commit comments