Skip to content

Commit

Permalink
add grants for build
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkoSekulic committed Jan 10, 2025
1 parent 913c90e commit 95b929f
Show file tree
Hide file tree
Showing 4 changed files with 273 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions backend/src/Designer/Migrations/20250110192106_BuildsGrants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Altinn.Studio.Designer.Migrations.SqlScripts;
using Altinn.Studio.Designer.Repository.ORMImplementation.Models;

Check warning on line 2 in backend/src/Designer/Migrations/20250110192106_BuildsGrants.cs

View workflow job for this annotation

GitHub Actions / Format check

Using directive is unnecessary.
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Altinn.Studio.Designer.Migrations
{
/// <inheritdoc />
public partial class BuildsGrants : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(SqlScriptsReadHelper.ReadSqlScript("Builds/01-setup-grants.sql"));
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

NpgsqlModelBuilderExtensions.UseSerialColumns(modelBuilder);

modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.AppScopesDbObject", b =>
modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.AppScopesDbModel", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
Expand Down Expand Up @@ -73,7 +73,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("app_scopes", "designer");
});

modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.BuildDbObject", b =>
modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.BuildDbModel", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
Expand Down Expand Up @@ -116,7 +116,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("builds", "designer");
});

modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.Deployment", b =>
modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.DeploymentDbModel", b =>
{
b.Property<long>("Sequenceno")
.ValueGeneratedOnAdd()
Expand Down Expand Up @@ -175,7 +175,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("deployments", "designer");
});

modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.Release", b =>
modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.ReleaseDbModel", b =>
{
b.Property<long>("Sequenceno")
.ValueGeneratedOnAdd()
Expand Down Expand Up @@ -224,9 +224,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("releases", "designer");
});

modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.Deployment", b =>
modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.DeploymentDbModel", b =>
{
b.HasOne("Altinn.Studio.Designer.Repository.ORMImplementation.Models.BuildDbObject", "Build")
b.HasOne("Altinn.Studio.Designer.Repository.ORMImplementation.Models.BuildDbModel", "Build")
.WithMany()
.HasForeignKey("InternalBuildId")
.HasConstraintName("fk_deployments_builds_buildid");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GRANT SELECT,INSERT,UPDATE,DELETE ON ALL TABLES IN SCHEMA designer TO designer;

0 comments on commit 95b929f

Please sign in to comment.