fixes
This commit is contained in:
@@ -61,6 +61,10 @@ func (s *Service) UpsertPositionForLocale(ctx context.Context, code, locale, nam
|
||||
return s.positions.UpsertPositionForLocale(ctx, code, locale, name, description)
|
||||
}
|
||||
|
||||
func (s *Service) DeletePosition(ctx context.Context, code string) error {
|
||||
return s.positions.DeletePositionByCode(ctx, code)
|
||||
}
|
||||
|
||||
func (s *Service) AssignPosition(ctx context.Context, adminID, targetUserID uuid.UUID, input models.AssignPositionInput) error {
|
||||
position, err := s.positions.GetPositionByCode(ctx, input.PositionCode)
|
||||
if err != nil {
|
||||
@@ -84,6 +88,18 @@ func (s *Service) RevokePosition(ctx context.Context, targetUserID uuid.UUID, po
|
||||
return s.positions.RevokePosition(ctx, targetUserID, position.ID)
|
||||
}
|
||||
|
||||
func (s *Service) CreatePermission(ctx context.Context, code string, description *string) error {
|
||||
return s.positions.CreatePermission(ctx, code, description)
|
||||
}
|
||||
|
||||
func (s *Service) UpdatePermission(ctx context.Context, code string, description *string) error {
|
||||
return s.positions.UpdatePermission(ctx, code, description)
|
||||
}
|
||||
|
||||
func (s *Service) DeletePermission(ctx context.Context, code string) error {
|
||||
return s.positions.DeletePermission(ctx, code)
|
||||
}
|
||||
|
||||
func (s *Service) UserHasPermission(ctx context.Context, userID uuid.UUID, permissionCode string) (bool, error) {
|
||||
allowed, _, err := s.positions.UserHasPermission(ctx, userID, permissionCode)
|
||||
return allowed, err
|
||||
|
||||
Reference in New Issue
Block a user