Serenity: Authorizing Problem

Created on 20 Jun 2017  路  3Comments  路  Source: serenity-is/Serenity

Hello, I created a sample application with your startup template and after that I decided to create some Api's for solution and test it functionalities. so I added a controller and some action methods to it, then I added below codes to my Index action to get a list of meeting locations:

  _var connection = SqlConnections.NewFor<MeetingLocationRow>();
  var request = new ListRequest();
  var locations = new MeetingLocationRepository().List<connection, request>().Entities;_

now when I want to call this action the application raise an exception and said "Authorization has been denied for this request", I wondered why there is no approach to disable authorization, because for some records we don't need any authorization for example when we add a HomeController and set Route("~") for this controller and use a custom theme to show users before they can login to admin panel and we want to show some statistics that we inserted to some tables.
after a lot search I found this link https://github.com/volkanceylan/Serenity/issues/806 that you explained how to call services from another applications. so by the way Serenity creates appropriate services for all generated class but for calling any method of any service we have to logged in.

Most helpful comment

Remove authorization attributes from Endpoint, Row ....

All 3 comments

you can remove the following attribute from your MeetingLocationRow.cs
[ReadPermission("xxx:MeetingLocation:Read")]

I did it, but when try to call the service it throws and exception and said "ReadPermission" is not presented

Remove authorization attributes from Endpoint, Row ....

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Akarsh03 picture Akarsh03  路  3Comments

kilroyFR picture kilroyFR  路  3Comments

dkontod picture dkontod  路  3Comments

Amitloh picture Amitloh  路  3Comments

JohnRanger picture JohnRanger  路  3Comments