ngx-admin-bundle-support icon indicating copy to clipboard operation
ngx-admin-bundle-support copied to clipboard

Admin Role Example

Open worldfellow opened this issue 5 years ago • 7 comments

Hi after purchasing node demo there is no admin based example there is just one file admin.gaurd.ts how should we use it also can we have a roles working example please

worldfellow avatar Jul 10 '19 11:07 worldfellow

I also have no clue about this subject. How can one let appear the "Users"-button in the navigation pane? Do you have a bit more documentation how to set up users and roles ? users-pane

I use your new released NODE_Starter Angular 8 + Nebular 4. Just a remark on the Release: the express server 'app.js' was not included in the package.

Cappmax avatar Jul 16 '19 09:07 Cappmax

@Cappmax I have uploaded fixed node_starter to the store, you should receive link to the updated package. Thanks for the issue, it helped me to fix our CI process.

valentinkononov avatar Jul 18 '19 09:07 valentinkononov

User Administration functionality (table with all users, all users editing for Admin role user) is available in full ecom node bundle. With full bundle you have Users menu and table out of the box.

The idea is to use roles mechanism of Nebular - docs

There is role schema setup in authModule, role.provider (reading role from JWT token), and usage of AuthGuard, AdminGuard and nbIsGranted directive to limit user access based on role.

valentinkononov avatar Jul 18 '19 09:07 valentinkononov

@valentinkononov does full functions of User Admin come with .NET Core IoT Bundle?

unruledboy avatar Oct 09 '19 20:10 unruledboy

@valentinkononov I bought the .NET Core IoT Bundle, but I could not see the users list, where is it?

unruledboy avatar Oct 12 '19 01:10 unruledboy

@valentinkononov I figured it out, by adding UsersModule in pages.module.ts. Not sure it is the right way, though.

Actually, it will only work if I change the Discriminator of the admin user in table to be "admin" then the menu will show, but it will cause the login to fail.

I debugged it, FindByEmailAsync returns null, after turning on the EF Core debug, the SQL query is like this:

[u].[Discriminator] = N'User'

which means it is expecting the Discriminator to be user, NOT admin

unruledboy avatar Oct 12 '19 01:10 unruledboy

@valentinkononov

And I keep getting the following errors, whenever I sign out and sign in again.

Also, looks like /api/network-aggregated?period=month RESTful API is not working. Is it possible you changed it to "energy-aggregated"? As you can see below, the "Traffic Consumption" is broken

image

image

unruledboy avatar Oct 12 '19 02:10 unruledboy