(p *database.Project, orgName string)
| 2158 | } |
| 2159 | |
| 2160 | func (s *Server) projToDTO(p *database.Project, orgName string) *adminv1.Project { |
| 2161 | return &adminv1.Project{ |
| 2162 | Id: p.ID, |
| 2163 | Name: p.Name, |
| 2164 | OrgId: p.OrganizationID, |
| 2165 | OrgName: orgName, |
| 2166 | Description: p.Description, |
| 2167 | Public: p.Public, |
| 2168 | CreatedByUserId: safeStr(p.CreatedByUserID), |
| 2169 | DirectoryName: p.DirectoryName, |
| 2170 | Provisioner: p.Provisioner, |
| 2171 | ProdVersion: p.ProdVersion, |
| 2172 | ProdSlots: int64(p.ProdSlots), |
| 2173 | DevSlots: int64(p.DevSlots), |
| 2174 | PrimaryBranch: p.PrimaryBranch, |
| 2175 | Subpath: p.Subpath, |
| 2176 | GitRemote: safeStr(p.GitRemote), |
| 2177 | ManagedGitId: safeStr(p.ManagedGitRepoID), |
| 2178 | ArchiveAssetId: safeStr(p.ArchiveAssetID), |
| 2179 | PrimaryDeploymentId: safeStr(p.PrimaryDeploymentID), |
| 2180 | ProdTtlSeconds: safeInt64(p.ProdTTLSeconds), |
| 2181 | DevTtlSeconds: p.DevTTLSeconds, |
| 2182 | OverrideDiskGb: safeInt64(p.OverrideDiskGB), |
| 2183 | FrontendUrl: s.admin.URLs.Project(orgName, p.Name), |
| 2184 | Annotations: p.Annotations, |
| 2185 | CreatedOn: timestamppb.New(p.CreatedOn), |
| 2186 | UpdatedOn: timestamppb.New(p.UpdatedOn), |
| 2187 | } |
| 2188 | } |
| 2189 | |
| 2190 | func (s *Server) hasAssetUsagePermission(ctx context.Context, id, orgID, ownerID string) bool { |
| 2191 | asset, err := s.admin.DB.FindAsset(ctx, id) |
no test coverage detected