Closed mmazloum closed 7 years ago
Have you tried setting s default role. Take a look at orion examples blog. I believe its under startup. I'm planning to fix this in scorpius core. But for now that also existed in the original project.
On Thu, Sep 15, 2016, 10:09 AM mmazloum notifications@github.com wrote:
First I'm used to orion and Meteor, and I'm pleased to see this scorpius project.
I get this error when ever I try to create my first admin user : (STDERR) Error: Match error: Expected string, got object (STDERR) at exports.check (packages/check/match.js:34:1) (STDERR) at Object.Roles.addUserToRoles (packages/nicolaslopezj_roles/roles_server.js:18:1) (STDERR) at Object. (packages/scorpiusjs:accounts/accounts_server.js:13:11)
It seems that scorpius uses nicolaslopezj_roles in its core and anytime a user is created, even if I don't ask to add a role this error occurs ?
This results in not being able to see my collections in the side menu.
Any idea of what happens ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/scorpiusjs/scorpius/issues/17, or mute the thread https://github.com/notifications/unsubscribe-auth/AFFsSUacAQMwrOlJYCE4Pk-aWTzo685Yks5qqXvBgaJpZM4J-G_Z .
here is a work arround (to replace the fixture suggested in the orion tutorial): ` if ( Meteor.users.find().count() === 0) { console.log("Adding Marwan"); marwanId = Accounts.createUser({ profile: { name: 'Marwan Mazloum' }, username: 'Marwan', email: 'XXXXXX', password: 'XXXXX' }); console.log("Marwan Id :" + marwanId); Roles.addUserToRoles(marwanId, ["admin"]); }
let marwan = Meteor.users.findOne({username: 'Marwan'});
if (marwan) {
console.log(marwan);
Roles.addUserToRoles(marwan._id, ["admin"]);
}`
then my default profile activates admin functions in orion CMS.
This is nice.
I'll be sure to update docs after testing, across other roles etc. ...
P.s. Scorpius docs are still to come they will be available in the near future.
@rwatts3 this is a show stopper, I was about to switch to Yogiben admin panel because I couldn't find a solution
@codeHatcher if you add the role in a second if() the role is added.
@mmazloum that's what I ended up doing
@codeHatcher ; can i see an example of what worked for you? this is making my server skip and only started when i tried to add multiple admins.
@tdotholla I don't remember which project I was using when I had this issue. If you can give me something simple that reproduces your error I don't mind spend 15 minutes to try and fix it for you
or at the very least show me your fixture code and error message
First I'm used to orion and Meteor, and I'm pleased to see this scorpius project.
I get this error when ever I try to create my first admin user : (STDERR) Error: Match error: Expected string, got object (STDERR) at exports.check (packages/check/match.js:34:1) (STDERR) at Object.Roles.addUserToRoles (packages/nicolaslopezj_roles/roles_server.js:18:1) (STDERR) at Object. (packages/scorpiusjs:accounts/accounts_server.js:13:11)
It seems that scorpius uses nicolaslopezj_roles in its core and anytime a user is created, even if I don't ask to add a role this error occurs ?
This results in not being able to see my collections in the side menu.
Any idea of what happens ?