File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ impl FromRequest for Query {
8989 match permission {
9090 Permission :: Stream ( Action :: All , _) => authorized = true ,
9191 Permission :: StreamWithTag ( Action :: Query , stream, tag)
92- if stream == query. stream_name =>
92+ if stream == query. stream_name || stream == "*" =>
9393 {
9494 authorized = true ;
9595 if let Some ( tag) = tag {
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ pub mod model {
110110 Admin ,
111111 Editor ,
112112 Writer { stream : String } ,
113- Reader { stream : String , tag : String } ,
113+ Reader { stream : String , tag : Option < String > } ,
114114 }
115115
116116 impl From < & DefaultPrivilege > for RoleBuilder {
@@ -121,9 +121,13 @@ pub mod model {
121121 DefaultPrivilege :: Writer { stream } => {
122122 writer_perm_builder ( ) . with_stream ( stream. to_owned ( ) )
123123 }
124- DefaultPrivilege :: Reader { stream, tag } => reader_perm_builder ( )
125- . with_stream ( stream. to_owned ( ) )
126- . with_tag ( tag. to_owned ( ) ) ,
124+ DefaultPrivilege :: Reader { stream, tag } => {
125+ let mut reader = reader_perm_builder ( ) . with_stream ( stream. to_owned ( ) ) ;
126+ if let Some ( tag) = tag {
127+ reader = reader. with_tag ( tag. to_owned ( ) )
128+ }
129+ reader
130+ }
127131 }
128132 }
129133 }
You can’t perform that action at this time.
0 commit comments