mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 06:45:43 +00:00
feat(BE-74): add production standart to project_flock and implement rbac finance and standart production
This commit is contained in:
@@ -104,12 +104,11 @@ func AuthenticatedUser(c *fiber.Ctx) (*entity.User, bool) {
|
||||
}
|
||||
|
||||
func ActorIDFromContext(c *fiber.Ctx) (uint, error) {
|
||||
// user, ok := AuthenticatedUser(c)
|
||||
// if !ok || user == nil || user.Id == 0 {
|
||||
// return 0, fiber.NewError(fiber.StatusUnauthorized, "Please authenticate")
|
||||
// }
|
||||
// return user.Id, nil
|
||||
return 1, nil
|
||||
user, ok := AuthenticatedUser(c)
|
||||
if !ok || user == nil || user.Id == 0 {
|
||||
return 0, fiber.NewError(fiber.StatusUnauthorized, "Please authenticate")
|
||||
}
|
||||
return user.Id, nil
|
||||
}
|
||||
|
||||
// AuthDetails returns the full authentication context (token, claims, user).
|
||||
|
||||
@@ -162,8 +162,32 @@ const (
|
||||
P_WarehousesCreateOne = "lti.master.warehouses.create"
|
||||
P_WarehousesUpdateOne = "lti.master.warehouses.update"
|
||||
P_WarehousesDeleteOne = "lti.master.warehouses.delete"
|
||||
|
||||
P_Production_Standart_GetAll = "lti.master.production_standards.list"
|
||||
P_Production_Standart_CreateOne = "lti.master.production_standards.create"
|
||||
P_Production_Standart_GetOne = "lti.master.production_standards.detail"
|
||||
P_Production_Standart_UpdateOne = "lti.master.production_standards.update"
|
||||
P_Production_Standart_DeleteOne = "lti.master.production_standards.delete"
|
||||
)
|
||||
|
||||
// finance
|
||||
const (
|
||||
P_Finances_Initial_Balances_CreateOne = "lti.finance.initial_balances.create"
|
||||
P_Finances_Initial_Balances_GetOne = "lti.finance.initial_balances.detail"
|
||||
P_Finances_Initial_Balances_UpdateOne = "lti.finance.initial_balances.update"
|
||||
|
||||
P_Finances_Injections_CreateOne = "lti.finance.injections.create"
|
||||
P_Finances_Injections_GetOne = "lti.finance.injections.detail"
|
||||
P_Finances_Injections_UpdateOne = "lti.finance.injections.update"
|
||||
|
||||
P_Finances_Payments_CreateOne = "lti.finance.payments.create"
|
||||
P_Finances_Payments_UpdateOne = "lti.finance.payments.update"
|
||||
P_Finances_Payments_GetOne = "lti.finance.payments.detail"
|
||||
|
||||
P_Finances_Transaction_GetAll = "lti.finance.transactions.list"
|
||||
P_Finances_Transaction_GetOne = "lti.finance.transactions.detail"
|
||||
P_Finances_Transaction_DeleteOne = "lti.finance.transactions.delete"
|
||||
)
|
||||
const (
|
||||
P_ChickinsCreateOne = "lti.production.chickins.create"
|
||||
P_ChickinsGetOne = "lti.production.chickins.detail"
|
||||
|
||||
Reference in New Issue
Block a user