1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-08-08 22:36:41 +02:00

WIP: not sure how to solve user_account calling account.CanModifyAccount

This commit is contained in:
Lee Brown
2019-08-13 23:41:06 -08:00
parent 4be0454421
commit 3bc814a01e
8 changed files with 198 additions and 132 deletions

View File

@ -49,14 +49,14 @@ func mapRowsToUserAccount(rows *sql.Rows) (*UserAccount, error) {
}
// CanReadAccount determines if claims has the authority to access the specified user account by user ID.
func CanReadAccount(ctx context.Context, claims auth.Claims, dbConn *sqlx.DB, accountID string) error {
err := account.CanReadAccount(ctx, claims, dbConn, accountID)
func (repo *Repository) CanReadAccount(ctx context.Context, claims auth.Claims, accountID string) error {
err := account.CanReadAccount(ctx, claims, accountID)
return mapAccountError(err)
}
// CanModifyAccount determines if claims has the authority to modify the specified user ID.
func CanModifyAccount(ctx context.Context, claims auth.Claims, dbConn *sqlx.DB, accountID string) error {
err := account.CanModifyAccount(ctx, claims, dbConn, accountID)
func (repo *Repository) CanModifyAccount(ctx context.Context, claims auth.Claims, accountID string) error {
err := account.CanModifyAccount(ctx, claims, accountID)
return mapAccountError(err)
}