29 lines
626 B
Dart
29 lines
626 B
Dart
import 'package:rasadyar_core/core.dart';
|
|
|
|
class RoleLogic extends GetxController {
|
|
TokenStorageService tokenService = Get.find<TokenStorageService>();
|
|
GService gService = Get.find<GService>();
|
|
RxList<String> roles = <String>[].obs;
|
|
|
|
@override
|
|
void onInit() {
|
|
super.onInit();
|
|
List<String> items = tokenService.getUserLocal(Module.chicken)!.roles ?? [];
|
|
if (items.isNotEmpty ?? false) {
|
|
roles.assignAll(items);
|
|
}
|
|
}
|
|
|
|
@override
|
|
void onReady() {
|
|
// TODO: implement onReady
|
|
super.onReady();
|
|
}
|
|
|
|
@override
|
|
void onClose() {
|
|
// TODO: implement onClose
|
|
super.onClose();
|
|
}
|
|
}
|