Skip to content

Commit

Permalink
(chocolateyGH-432) Admin only repositories
Browse files Browse the repository at this point in the history
Set up an admin only repository to be set and configured by
ChocolateyGUI.
  • Loading branch information
ferventcoder committed Aug 29, 2017
1 parent e5f09d6 commit fe7a307
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/ChocolateyGui.Shared/Models/ChocolateySource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class ChocolateySource : IEquatable<ChocolateySource>

public bool AllowSelfService { get; set; }

public bool VisibleToAdminsOnly { get; set; }

public bool Equals(ChocolateySource other)
{
if (ReferenceEquals(null, other))
Expand All @@ -62,6 +64,7 @@ public bool Equals(ChocolateySource other)
&& string.Equals(CertificatePassword, other.CertificatePassword)
&& BypassProxy == other.BypassProxy
&& AllowSelfService == other.AllowSelfService
&& VisibleToAdminsOnly == other.VisibleToAdminsOnly
;
}

Expand Down Expand Up @@ -99,6 +102,7 @@ public override int GetHashCode()
hashCode = (hashCode * 397) ^ (CertificatePassword?.GetHashCode() ?? 0);
hashCode = (hashCode * 397) ^ BypassProxy.GetHashCode();
hashCode = (hashCode * 397) ^ AllowSelfService.GetHashCode();
hashCode = (hashCode * 397) ^ VisibleToAdminsOnly.GetHashCode();
return hashCode;
}
}
Expand Down
1 change: 1 addition & 0 deletions Source/ChocolateyGui.Subprocess/ChocolateyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ public async Task AddSource(ChocolateySource source)
config.SourceCommand.Priority = source.Priority;
config.SourceCommand.BypassProxy = source.BypassProxy;
config.SourceCommand.AllowSelfService = source.AllowSelfService;
config.SourceCommand.VisibleToAdminsOnly = source.VisibleToAdminsOnly;
});

await choco.RunAsync(operationContext.GetCancellationToken());
Expand Down
1 change: 1 addition & 0 deletions Source/ChocolateyGui/Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
<DataGridCheckBoxColumn Header="{x:Static lang:Resources.SettingsView_SourcesDisabled}" Width="Auto" Binding="{Binding Disabled}"/>
<DataGridCheckBoxColumn Header="{x:Static lang:Resources.SettingsView_SourcesByPassProxy}" Width="Auto" Binding="{Binding BypassProxy}"/>
<DataGridCheckBoxColumn Header="{x:Static lang:Resources.SettingsView_SourcesSelfService}" Width="Auto" Binding="{Binding AllowSelfService}"/>
<DataGridCheckBoxColumn Header="{x:Static lang:Resources.SettingsView_SourcesSelfService}" Width="Auto" Binding="{Binding VisibleToAdminsOnly}"/>
</DataGrid.Columns>
</DataGrid>
<DockPanel Grid.Row="2" Grid.Column="0" Margin="5">
Expand Down

0 comments on commit fe7a307

Please sign in to comment.