the method getCatalog()
of the wakanda javascript client returns the following error, if no data class array is passed to the method and one of the describe permissions in the model is missing for the current user (this is most likely the case).
Error:
{
"__ERROR": [
{
"message": "No permission to describe the User datastore class",
"componentSignature": "dbmg",
"errCode": 1609
}
]
}
What is considered best practice to use the getCatalog()
method? Is it best to pass the data class needed to the getCatalog()
method on every call made to the server?
Example of angular company service:
@Injectable()
export class CompanyService {
constructor(private wakandaService: WakandaService,
private exceptionService: ExceptionService) {
}
getCompanyList(): any {
return this.wakandaService.getCatalog(['Company'])
.then(data => {
return data.UserProfile.getProfile();
})
.then(data => {
return data;
})
.catch(error => this.exceptionService.error(error));
}
}
UPDATE:
DataModel
Permissions
Role & User data class need "Admin" permissions. UserProfile data class needs "User" permissions and is extended from the User data class.
Error
When logged in as User and call getCatalog(['UserProfile'])
the error "Needed Role dataClass is not present on catalog" is returned. -> Is this correct? Why is the same thing through the REST API working?
http://localhost:8081/rest/$catalog/UserProfile works just fine.
When logged in as User and call getCatalog(['UserProfile', 'Role'])
the error "No permission to describe the Role datastore class" is returned. -> OK
Not sure yet to have all the details needed to perfectly answer you (not sure about how your model is defined (User, UserProfile..) . But however here's how it works. When passing a Dataclass in the getCatalog() method it retrieves only the specified dataclass.
Attention If your dataclasses are linked (relation <> ) you must add the related dataclasses (the expand is automatically needed )
You should be able to make it work by simply writing return
this.wakandaService.getCatalog(['Company', 'User'])
Of course you can also pass an empty array to get the whole catalog
this.wakandaService.getCatalog()
Could you confirm me that it solves your issue ?
Thanks :)