This was my fault. I left @page
in at the top of the page when I created the new file. All sorted now. Thanks for the help.
Thank you, it worked. I had tried to use the UserManager but obviously was too lazy to find its namespace so wasted a question instead!
Thanks for your help.
Thank you - the first part to remove the security logs from the menu works!
On the new Default.cshtml page though the actual Model object is null, so it fails on the line checking Model.Items.Any()
.
The model in your code is an ApplicationMenu which seems correct.
Any ideas what the issue is?
Hi, I feel like this is an easy one...
I have a new property (bool Active) on the User object, stored in ExtraProperties. I want to reference it on the razor page, but the CurrentUser (ICurrentUser) object doesn't have it or ExtraProperties. How can I read the value?
In my example basically I want to do:
@if (CurrentUser.IsAuthenticated && CurrentUser.ExtraProperties["Active"])
Hi, I have added a new boolean field to the User object called Active. I have overwridden the Register page to set this to false for new users and it works.
I have also added a new menu item under User Management that goes to Identity/Users/Inactive. I've created the Inactive.cshtml/cs page for it, as well as Inactive.js to edit the Actions to only have Activate and Delete. The Activate function correctly sets the field to true and reloads the page, so most of what I want is working.
My problem: how do I filter the Users list that loads on the Inactive page? I have only been able to use the 'filter' option but that seems to only search on name/surname, and I can't get it to filter on another field.
That part of the js file is:
var _$table = _$wrapper.find('table');
var getInactiveFilter = function () {
return {
filter: 'test',
};
};
abp.libs.datatables.normalizeConfiguration({
order: [[1, 'asc']],
processing: true,
serverSide: true,
scrollX: true,
paging: true,
ajax: abp.libs.datatables.createAjax(
_identityUserAppService.getList, getInactiveFilter
),
columnDefs: abp.ui.extensions.tableColumns.get('identity.user').columns.toArray()
})
);
I have tried to make the getInactiveFilter function look like this (testing on a named field before attempting ExtraProperties):
var getInactiveFilter = function () {
return {
name: 'test',
};
};
That doesn't work at all - the parameter isn't even passed in the ajax request.
What I really want to do is filter the list in 2 ways (at once):
The Inactive page is only visible to users within a certain role, and they will be approving new users that register within their OU structure. Can anyone help with the filtering?
Hi, I'd like to customise the user menu in the main toolbar:
I can see the function ConfigureToolbarAsync in the ToolbarContributor where it gets added, but I don't know how to edit the object or intercept it. I am guessing I need to override the class that calls ConfigureToolbarAsync but I am too new to this so am a little lost. Help is appreciated!