@@ -181,52 +181,54 @@ struct NCAccountSettingsView: View {
181181 }
182182 ///
183183 /// Certificate server
184- Button ( action: {
185- showServerCertificate. toggle ( )
186- } , label: {
187- HStack {
188- Image ( systemName: " lock " )
189- . resizable ( )
190- . scaledToFit ( )
191- . font ( Font . system ( . body) . weight ( . light) )
192- . frame ( width: 20 , height: 20 )
193- . foregroundStyle ( Color ( NCBrandColor . shared. iconImageColor) )
194- Text ( NSLocalizedString ( " _certificate_details_ " , comment: " " ) )
195- . lineLimit ( 1 )
196- . truncationMode ( . middle)
197- . foregroundStyle ( Color ( NCBrandColor . shared. textColor) )
198- . padding ( EdgeInsets ( top: 0 , leading: 0 , bottom: 0 , trailing: 20 ) )
199- }
200- . font ( . system( size: 14 ) )
201- } )
202- . sheet ( isPresented: $showServerCertificate) {
203- if let url = URL ( string: model. activeAccount? . urlBase) , let host = url. host {
204- certificateDetailsView ( host: host, title: NSLocalizedString ( " _certificate_view_ " , comment: " " ) )
205- }
206- }
207- ///
208- /// Certificate push
209- Button ( action: {
210- showPushCertificate. toggle ( )
211- } , label: {
212- HStack {
213- Image ( systemName: " lock " )
214- . resizable ( )
215- . scaledToFit ( )
216- . font ( Font . system ( . body) . weight ( . light) )
217- . frame ( width: 20 , height: 20 )
218- . foregroundStyle ( Color ( NCBrandColor . shared. iconImageColor) )
219- Text ( NSLocalizedString ( " _certificate_pn_details_ " , comment: " " ) )
220- . lineLimit ( 1 )
221- . truncationMode ( . middle)
222- . foregroundStyle ( Color ( NCBrandColor . shared. textColor) )
223- . padding ( EdgeInsets ( top: 0 , leading: 0 , bottom: 0 , trailing: 20 ) )
184+ if model. isAdminGroup ( ) {
185+ Button ( action: {
186+ showServerCertificate. toggle ( )
187+ } , label: {
188+ HStack {
189+ Image ( systemName: " lock " )
190+ . resizable ( )
191+ . scaledToFit ( )
192+ . font ( Font . system ( . body) . weight ( . light) )
193+ . frame ( width: 20 , height: 20 )
194+ . foregroundStyle ( Color ( NCBrandColor . shared. iconImageColor) )
195+ Text ( NSLocalizedString ( " _certificate_details_ " , comment: " " ) )
196+ . lineLimit ( 1 )
197+ . truncationMode ( . middle)
198+ . foregroundStyle ( Color ( NCBrandColor . shared. textColor) )
199+ . padding ( EdgeInsets ( top: 0 , leading: 0 , bottom: 0 , trailing: 20 ) )
200+ }
201+ . font ( . system( size: 14 ) )
202+ } )
203+ . sheet ( isPresented: $showServerCertificate) {
204+ if let url = URL ( string: model. activeAccount? . urlBase) , let host = url. host {
205+ certificateDetailsView ( host: host, title: NSLocalizedString ( " _certificate_view_ " , comment: " " ) )
206+ }
224207 }
225- . font ( . system( size: 14 ) )
226- } )
227- . sheet ( isPresented: $showPushCertificate) {
228- if let url = URL ( string: NCBrandOptions . shared. pushNotificationServerProxy) , let host = url. host {
229- certificateDetailsView ( host: host, title: NSLocalizedString ( " _certificate_pn_view_ " , comment: " " ) )
208+ ///
209+ /// Certificate push
210+ Button ( action: {
211+ showPushCertificate. toggle ( )
212+ } , label: {
213+ HStack {
214+ Image ( systemName: " lock " )
215+ . resizable ( )
216+ . scaledToFit ( )
217+ . font ( Font . system ( . body) . weight ( . light) )
218+ . frame ( width: 20 , height: 20 )
219+ . foregroundStyle ( Color ( NCBrandColor . shared. iconImageColor) )
220+ Text ( NSLocalizedString ( " _certificate_pn_details_ " , comment: " " ) )
221+ . lineLimit ( 1 )
222+ . truncationMode ( . middle)
223+ . foregroundStyle ( Color ( NCBrandColor . shared. textColor) )
224+ . padding ( EdgeInsets ( top: 0 , leading: 0 , bottom: 0 , trailing: 20 ) )
225+ }
226+ . font ( . system( size: 14 ) )
227+ } )
228+ . sheet ( isPresented: $showPushCertificate) {
229+ if let url = URL ( string: NCBrandOptions . shared. pushNotificationServerProxy) , let host = url. host {
230+ certificateDetailsView ( host: host, title: NSLocalizedString ( " _certificate_pn_view_ " , comment: " " ) )
231+ }
230232 }
231233 }
232234 } )
0 commit comments