Change transaction to bank_transaction for permissions
This commit is contained in:
parent
fd2d7bb008
commit
706b22beb5
|
|
@ -43,11 +43,8 @@ class EntityType extends EnumClass {
|
|||
static const EntityType design = _$design;
|
||||
// STARTER: entity type - do not remove comment
|
||||
static const EntityType transactionRule = _$transactionRule;
|
||||
|
||||
static const EntityType transaction = _$transaction;
|
||||
|
||||
static const EntityType bankAccount = _$bankAccount;
|
||||
|
||||
static const EntityType recurringExpense = _$recurringExpense;
|
||||
static const EntityType recurringQuote = _$recurringQuote;
|
||||
static const EntityType subscription = _$subscription;
|
||||
|
|
@ -231,6 +228,14 @@ class EntityType extends EnumClass {
|
|||
|
||||
String get snakeCase => toSnakeCase(toString());
|
||||
|
||||
String get apiValue {
|
||||
if (this == EntityType.transaction) {
|
||||
return 'bank_transaction';
|
||||
}
|
||||
|
||||
return snakeCase;
|
||||
}
|
||||
|
||||
bool get hasFullWidthViewer => [
|
||||
EntityType.client,
|
||||
EntityType.vendor,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import 'package:invoiceninja_flutter/ui/user/edit/user_edit_vm.dart';
|
|||
import 'package:invoiceninja_flutter/utils/completers.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
import 'package:invoiceninja_flutter/utils/strings.dart';
|
||||
|
||||
class UserEdit extends StatefulWidget {
|
||||
const UserEdit({
|
||||
|
|
@ -360,10 +359,9 @@ class _UserEditState extends State<UserEdit>
|
|||
.where((entityType) =>
|
||||
state.company.isModuleEnabled(entityType))
|
||||
.map((EntityType type) {
|
||||
final createPermission =
|
||||
'create_' + toSnakeCase('$type');
|
||||
final editPermission = 'edit_' + toSnakeCase('$type');
|
||||
final viewPermission = 'view_' + toSnakeCase('$type');
|
||||
final createPermission = 'create_' + type.apiValue;
|
||||
final editPermission = 'edit_' + type.apiValue;
|
||||
final viewPermission = 'view_' + type.apiValue;
|
||||
return DataRow(cells: [
|
||||
DataCell(Text(localization.lookup('$type')),
|
||||
onTap: () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue