File tree 7 files changed +16
-3
lines changed
java/ru/mystamps/web/support/spring/security
resources/ru/mystamps/i18n
webapp/WEB-INF/views/series
7 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 21
21
- (functionality) add support for specifying Solovyov catalog numbers
22
22
- (functionality) add support for specifying Zagorski catalog numbers
23
23
- (functionality) user may specify how many stamps from a series in his/her collection
24
- - (functionality) user may specify a price that he/she paid for a series
24
+ - (functionality) paid users may specify a price that he/she paid for a series
25
25
26
26
0.3
27
27
- (functionality) implemented possibility to user to add series to his collection
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ public final class Authority {
26
26
public static final GrantedAuthority ADD_COMMENTS_TO_SERIES = new SimpleGrantedAuthority (StringAuthority .ADD_COMMENTS_TO_SERIES );
27
27
public static final GrantedAuthority ADD_IMAGES_TO_SERIES = new SimpleGrantedAuthority (StringAuthority .ADD_IMAGES_TO_SERIES );
28
28
public static final GrantedAuthority ADD_PARTICIPANT = new SimpleGrantedAuthority (StringAuthority .ADD_PARTICIPANT );
29
+ public static final GrantedAuthority ADD_SERIES_PRICE = new SimpleGrantedAuthority (StringAuthority .ADD_SERIES_PRICE );
29
30
public static final GrantedAuthority ADD_SERIES_SALES = new SimpleGrantedAuthority (StringAuthority .ADD_SERIES_SALES );
30
31
public static final GrantedAuthority CREATE_CATEGORY = new SimpleGrantedAuthority (StringAuthority .CREATE_CATEGORY );
31
32
public static final GrantedAuthority CREATE_COUNTRY = new SimpleGrantedAuthority (StringAuthority .CREATE_COUNTRY );
Original file line number Diff line number Diff line change @@ -79,13 +79,17 @@ private static Collection<? extends GrantedAuthority> getAuthorities(UserDetails
79
79
authorities .add (Authority .ADD_COMMENTS_TO_SERIES );
80
80
authorities .add (Authority .ADD_IMAGES_TO_SERIES );
81
81
authorities .add (Authority .ADD_PARTICIPANT );
82
+ authorities .add (Authority .ADD_SERIES_PRICE );
82
83
authorities .add (Authority .ADD_SERIES_SALES );
83
84
authorities .add (Authority .DOWNLOAD_IMAGE );
84
85
authorities .add (Authority .IMPORT_SERIES );
85
86
authorities .add (Authority .MANAGE_TOGGLZ );
86
87
authorities .add (Authority .VIEW_DAILY_STATS );
87
88
authorities .add (Authority .VIEW_SERIES_SALES );
88
89
authorities .add (Authority .VIEW_SITE_EVENTS );
90
+
91
+ } else if (userDetails .isPaidUser ()) {
92
+ authorities .add (Authority .ADD_SERIES_PRICE );
89
93
}
90
94
91
95
return authorities ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ public final class StringAuthority {
22
22
public static final String ADD_COMMENTS_TO_SERIES = "ADD_COMMENTS_TO_SERIES" ;
23
23
public static final String ADD_IMAGES_TO_SERIES = "ADD_IMAGES_TO_SERIES" ;
24
24
public static final String ADD_PARTICIPANT = "ADD_PARTICIPANT" ;
25
+ public static final String ADD_SERIES_PRICE = "ADD_SERIES_PRICE" ;
25
26
public static final String ADD_SERIES_SALES = "ADD_SERIES_SALES" ;
26
27
public static final String CREATE_CATEGORY = "CREATE_CATEGORY" ;
27
28
public static final String CREATE_COUNTRY = "CREATE_COUNTRY" ;
Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ t_yes = Yes
136
136
t_no = No
137
137
t_series_not_in_collection = Series isn't part of your collection
138
138
t_i_have = I have
139
+ t_only_for_paid_users = Only for paid users
139
140
t_i_bought_for = I bought for
140
141
t_out_of_n_stamps = out of {0} stamps
141
142
t_series_in_collection = Series is part of your collection
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ t_yes = Да
135
135
t_no = Нет
136
136
t_series_not_in_collection = Этой серии нет в вашей коллекции
137
137
t_i_have = У меня есть
138
+ t_only_for_paid_users = Только для платных пользователей
138
139
t_i_bought_for = Я купил за
139
140
t_out_of_n_stamps = из {0} марок
140
141
t_series_in_collection = Эта серия есть в вашей коллекции
Original file line number Diff line number Diff line change 369
369
th:text="${error}"></span>
370
370
</p>
371
371
/*/-->
372
- < p th:with ="price_msg=#{t_price} ">
372
+ < p th:with ="price_msg=#{t_price},paidUser=${#authorization.expression('hasAuthority(''ADD_SERIES_PRICE'')')} "
373
+ th:attrappend ="title=${paidUser ? null : '__#{t_only_for_paid_users}__'} ">
374
+
373
375
< span th:text ="#{t_i_bought_for} " th:remove ="tag "> I bought for</ span >
374
376
< input id ="paid-price "
375
377
type ="text "
376
378
size ="5 "
377
379
placeholder ="price "
378
380
th:placeholder ="${#strings.unCapitalize(price_msg)} "
379
381
th:field ="*{price} "
382
+ th:disabled ="${paidUser ? null : 'disabled'} "
380
383
/>
381
- < select id ="paid-currency " th:field ="*{currency} ">
384
+ < select id ="paid-currency "
385
+ th:field ="*{currency} "
386
+ th:disabled ="${paidUser ? null : 'disabled'} ">
382
387
< option value =""> </ option >
383
388
< option value ="USD "> USD</ option >
384
389
< option value ="EUR "> EUR</ option >
You can’t perform that action at this time.
0 commit comments