/// <inheritdoc cref="ISecurityManager.SavePermissionAsync(PermissionInfo)" /> public async Task <bool> SavePermissionAsync(PermissionInfo permissionInfo) { Permission permission = permissionInfo.ToPermission(); if (permissionInfo.PermissionId > 0) { _dbContext.KastraPermissions.Update(permission); } else { _dbContext.KastraPermissions.Add(permission); } await _dbContext.SaveChangesAsync(); // Return permission id permissionInfo.PermissionId = permission.PermissionId; // Clear cache _cacheEngine.ClearCacheContains("Module"); return(true); }