protected override void OnActivated() { base.OnActivated(); if (!SecuritySystem.IsGranted(new IsAdministratorPermissionRequest())) { var isGranted = SecuritySystem.IsGranted(new MyDetailsOperationRequest(new MyDetailsPermission(Modifier.Allow))); _myDetailsController = Frame.GetController <MyDetailsController>(); if (_myDetailsController != null) { _myDetailsController.Active.SetItemValue(KeyDisable, !isGranted); } _showNavigationItemController = Frame.GetController <ShowNavigationItemController>(); if (_showNavigationItemController != null) { _myDetailsItem = FindMyDetailsItem(_showNavigationItemController.ShowNavigationItemAction.Items); if (_myDetailsItem != null) { _myDetailsItem.Active.SetItemValue(KeyDisable, !isGranted); } } } else { Active["IsAdmin"] = false; } }
protected override void OnActivated() { base.OnActivated(); if (!SecuritySystem.IsGranted(new IsAdministratorPermissionRequest())) { var isGranted = SecuritySystem.IsGranted(new MyDetailsOperationRequest(new MyDetailsPermission(Modifier.Allow))); _myDetailsController = Frame.GetController<MyDetailsController>(); if (_myDetailsController != null) { _myDetailsController.Active.SetItemValue(keyDisable, !isGranted); } _showNavigationItemController = Frame.GetController<ShowNavigationItemController>(); if (_showNavigationItemController != null) { _myDetailsItem = FindMyDetailsItem(_showNavigationItemController.ShowNavigationItemAction.Items); if (_myDetailsItem != null) { _myDetailsItem.Active.SetItemValue(keyDisable, !isGranted); } } } else { Active["IsAdmin"] = false; } }