radzenhq / radzen-blazor-studio

Sample applications created with Radzen Blazor Studio
https://www.radzen.com/blazor-studio
16 stars 2 forks source link

Roles not visible when Setting Page Properties #91

Closed DaithiBradley closed 1 year ago

DaithiBradley commented 1 year ago

I am trying to set my page access to Authenticated.

When I try select a role from the drop down I see "Failed to get roles". When I try the refresh button there is no change.

I have added role from the page when logged in as admin/admin.

My page has @attribute [Authorize]. When I try to demo the app on IIS I cannot get past the login page, as I suspect the access roles are not set.

Is this a bug in the software, or do I need to set the role access in code only?

akorchev commented 1 year ago

Hi @TheKanky,

This is definitely not a known issue. The dropdown with roles should fetch them from the database via the AspNetRoles table. Here is how it is supposed to look:

image

Can you provide more info about your application?

  1. Is it an existing one or a new one created with Radzen Blazor Studio?
  2. What .NET version is it using?
  3. Is it Blazor server or WASM?
  4. What database is it using?
  5. Can you confirm the database has the AspNetRoles table and it contains the desired records?
DaithiBradley commented 1 year ago

Hi @akorchev

Thanks for the reply.

  1. This is a new project created with Radzen Blazor Studio.
  2. We are targeting Net7
  3. It is a Blazor Server app.
  4. Connecting to MySql.

CREATE TABLEAspNetRoles( Idvarchar(255) NOT NULL, ConcurrencyStamplongtext, Namevarchar(256) DEFAULT NULL, NormalizedNamevarchar(256) DEFAULT NULL, PRIMARY KEY (Id), UNIQUE KEYRoleNameIndex(NormalizedName) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci

image

image

akorchev commented 1 year ago

It seems there is a problem specific to MySQL databases. We will address it with the next release.

akorchev commented 1 year ago

Hi @TheKanky,

I am closing this issue as it should be fixed in latest versions.