Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "ddnils"

Hello Vitor, I would recommend you to use Azure on one App, it pretty much scales itself. - You usually don't need to split it.

I do use continuous integration with VS Online (took me about 1h to set up). One of the best features is, that it does all the testing before it provisions to azure web. - So if you use testing, this is a good option for you. But it has it's merits too. I once tried to publish a website with visual studio which was at the same time connected via continuous integration. This went horribly wrong and I worked for hours to get back a working version.

So my recommendation is to use continuous integration, if you do test a lot. (If you use a msdn subscription for the licensing be aware of the 5 builds per day limit). If not, you can use VS to publish to azure, it's easier to maintain.

Have a look at Entity Framework.

You can pretty much use either. If you just want Many to Many relationship, thats possible by just creating your Entities the right way:

public class Article: Entity<long> {
  public  long Id {get;set;}
  ...
  public virtual ICollection<Tag> Tags {get;set;}
}

public class Tag: Entity<long> {
  ...
  public virtual ICollection<Article> Articles {get;set;}
}

This should work. (EF creates your tables)

But if you want your relationship table to have additional fields (ie. CreationDate) you need to use FluentApi.

See this document for help: <a class="postlink" href="http://www.entityframeworktutorial.net/code-first/configure-many-to-many-relationship-in-code-first.aspx">http://www.entityframeworktutorial.net/ ... first.aspx</a>

Have you considered using

    private readonly UserManager _userManager;

in your Controller (use DI to get the actual Manager)?

this should give you: _userManager.GetUserByIdAsync()

Answer

So it seems I did misunderstand Permissions persistence.

I thought the permissions created through AuthorizationProvider.SetPermissions would be persisted inside AbpPermissions. But it seems they have to be created inside my AuthorizationProvider. For me that's a little strange. Why don't you persist the Names and Localisations to the Database (i.e. AbpPermissionNames)?

Also the error handling for the navigation menu (NavigationProvider) feels awkward. GetScripts fails completely when the Permission cannot be found. Would you mind, if I change this in Github? Or open an Issue on this?

Answer

Thank you, that worked (though I am not able to use IPermissionDefinitionContext).

I have set up Permission "Administration" like so: _context.Permissions.Add(new RolePermissionSetting { Name = "Administration", IsGranted = true, RoleId = 2 });

But when adding the Permission to NavigationProvider, like this: context.Manager.MainMenu .AddItem( new MenuItemDefinition( "Administration", new LocalizableString("Administration", "[MyAppName]"), // I use the Const here icon: "fa fa-cogs", requiresAuthentication: true, requiredPermissionName: "Administration" ));

I see an error in Developer Tools: <a class="postlink" href="http://localhost:6334/AbpScripts/GetScripts">http://localhost:6334/AbpScripts/GetScripts</a> Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Logs say this: ERROR 2015-10-13 10:20:08,845 [9 ] .Mvc.Controllers.AbpHandleErrorAttribute - Abp.AbpException: There is no permission with name: Administration

DB looks like this: 3 Administration True 13.10.2015 10:18:07 NULL 3 NULL RolePermissionSetting 4 Administration True 13.10.2015 10:18:07 NULL 4 NULL RolePermissionSetting

Something is still missing here, any advice?

Question

Hi there, i would like to seed permissions into my database. Since there is no IPermissionDefinitionContext available when working with InitialDataBuilder, I do not know how to do that. Do I have to create my own AuthorizationProvider for that? Any advice would be awesome.

I usually use a newPerson in $scope and bind its properties to my newForm directly so that the object is filled through angular.

To prefill use this: var emptyPerson = { name: "", age: 0 } $scope.newPerson = jQuery.extend({}, emptyPerson); // makes a copy of the object

hope this helps

Hey, I have tested

System.Threading.Thread.CurrentThread.CurrentUICulture

and LanguageManager through injection:

private readonly Abp.Localization.LanguageManager _lanManager;
_lanManager.CurrentLanguage

both work pretty much the same for me.

Have you checked embedded resources in Abp.Core?

Also check: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Localization">http://www.aspnetboilerplate.com/Pages/ ... calization</a>

Hi, I am not sure about this, but have you tried [Abp.WebApi.Authorization.AbpApiAuthorize] ?

Showing 11 to 20 of 28 entries