Test fails asp.net boilerplate. Abp.AbpException : There is no permission with name: Pages.Users - asp.net-boilerplate

When I run web.mvc project (of asp.net boilerplate template) the following exception is throwed:
Abp.AbpException: There is no permission with name: Pages.Tenants.
I updated database. How to fix these problems? Thank you

You can check AuthorizationProvider of your solution, in SetPermissions method, Permissions are added to the context.

Related

Flyway placeholders fails to read from Quarkus config

In quarkus 2.9.2.Final I try to configure flyway placeholders in src/test/resources/application.properties by
quarkus.flyway.placeholders.a=a
quarkus.flyway.placeholders.b=b
where in the flyway script these placeholder are used like
create user ${a} with password '${b}';
However, when I run the test which starts up db and executes flyway I get error
Caused by: org.flywaydb.core.api.FlywayException: No value provided for placeholder: ${a}. Check your configuration!
at org.flywaydb.core.internal.parser.PlaceholderReplacingReader.read(PlaceholderReplacingReader.java:165)
at java.base/java.io.FilterReader.read(FilterReader.java:65)
at org.flywaydb.core.internal.parser.PositionTrackingReader.read(PositionTrackingReader.java:33)
at java.base/java.io.FilterReader.read(FilterReader.java:65)
at org.flywaydb.core.internal.parser.RecordingReader.read(RecordingReader.java:33)
at java.base/java.io.FilterReader.read(FilterReader.java:65)
at org.flywaydb.core.internal.parser.PeekingReader.refillPeekBuffer(PeekingReader.java:73)
at org.flywaydb.core.internal.parser.PeekingReader.peek(PeekingReader.java:183)
at org.flywaydb.core.internal.parser.PeekingReader.peek(PeekingReader.java:165)
at org.flywaydb.core.internal.parser.Parser.readToken(Parser.java:478)
at org.flywaydb.core.internal.parser.Parser.getNextStatement(Parser.java:173)
... 73 more
I checked that my config is valid by defining a config mapping
#ConfigMapping(prefix = "quarkus.flyway")
interface MyConfig {
Map<String,String> placeholders();
}
and injecting it in a service where the Map was exactly having these two elements.
So now I really wonder why flyway quarkus extension cannot handle it / which trick I am missing.
Please help, I need this simple thing to work.
Oh no I found it..small but IMO nasty one driving me crazy.
In my project, Flyway is only to be used with my named datasource 'myds'.
So config had to be changed to:
quarkus.flyway.myds.placeholders.a=a
quarkus.flyway.myds.placeholders.b=b
Would be nice to have an error message which gives a clue. But maybe it's only my fault, so I guess not worth asking for improvement in flyway.

yii2 codeception doesn't generate unit suit

I red a ton of documentation and posts and it seems that almost everyone has problems with those yii2 codeception tests. My problem is that when I try to generate unit suit ./vendor/bin/codecept generate:test unit Login I get an error
In Configuration.php line 306: Suite unit was not loaded
What can cause this ? Have not found answer anywhere. Thank you!
EDIT - unit.suite.yml
suite_namespace: backend\tests\unit
suite_class: UnitTester
actor: UnitTester
modules:
enabled:
- Yii2:
part: [orm, email, fixtures]
- Asserts
The suite has to be specified. To specify it use -c backend
And the whole command should be:
./vendor/bin/codecept generate:test unit Login -c backend

Symfony3 : Generate crud doesn't work

I'm trying to use the generate crud feature with my new symfony3 project. I have created a bundle named AdminBundle with the generator, the entity test, also with the generator, all processed well to the end. I checked my file under, i have my class Test.php generated under my src/AdminBundle/Entity/Test.php folder. All is working well.
But when i try to generate a crud following the doc for my test entity with the following command :
bin/console generate:doctrine:crud
The Entity shortcut name: AdminBundle:Test
I get the following error :
[RuntimeException]
Entity "Test" does not exist in the "AdminBundle" bundle. You may have mistyped the bundle name or maybe the entity doesn't exist yet (create it first with the "doctrine:generate:entity" comm
and).
As i said, i already generated the entity with the "doctrine:generate:entity" command, and i type the same name ( AdminBundle:Test ) as i type in my crud generator.
Any ideas ?
I have the same problem with sf2.8.
What I did to solve this problem was:
first: generate the form for the entity.
php app/console doctrine:generate:form NameBundle:EntityName
Second: generate the CRUD for Entity
php app/console doctrine:generate:crud
I just ran into this problem. One of my entity's attributes annotations were mistyped, causing this error. Check your attributes annotations.
I had to do bin/console doctrine:schema:update for it to acknowledge the entity as I had the class but the entity was not in the DB yet.
It's an old issue. But I face it too, just now. I solved it by pointing the class with whole name space.
$test = new \AppBundle\Entity\Test();

Object of type 'manifest' and path 'C:\CustomManifest.xml' cannot be created

I am struggling with msdeploy (aka Web Deploy). I have tried to create a simple manifest (from the example of MSDN) :
<sitemanifest>
<appHostConfig path="mySite" />
</sitemanifest>
Unfortunately, any command with this manifest as a source dies with the following message :
msdeploy -verb:dump -source:manifest=c:\CustomManifest.xml
Error: Object of type 'manifest' and path 'C:\CustomManifest.xml' cannot be created.
Error: One or more entries in the manifest 'sitemanifest' are not valid.
Error Code: ERROR_SITE_DOES_NOT_EXIST
More Information: Site 'mySite' does not exist. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_SITE_DOES_NOT_EXIST.
Error count: 1.
Any Idea ?
OK, finally understood my issue : a manifest is made only to export what you need. It is not made to generate something from scratch. To generate a web site, the package provider has to be used.

Login failed for user 'username' - System.Data.SqlClient.SqlException with LINQ in external project / class library

This might seem obvious but I've had this error when trying to use LINQ to SQL with my business logic in a separate class library project.
I've created the DBML in a class library, with all my business logic and custom controls in this project. I'd referenced the class library from my web project and attempted to use it directly from the web project.
The error indicated the login failed for my user name. My user name and password were correct, but the fix was to copy my connection string to the correct location. I've learned the issue from another site and thought I would make a note here.
Error:
Login failed for user 'username'
System.Data.SqlClient.SqlException
The LINQ designer ads the connection string to the app.config of the class library, but the web site needed to see it in the web.config of the web project. Once copied across all was well.
you can pass in a connection or connection string to the data context as well.