Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on Meteor 0.9.3 #59

Closed
Furqankhanzada opened this issue Sep 27, 2014 · 5 comments
Closed

Not working on Meteor 0.9.3 #59

Furqankhanzada opened this issue Sep 27, 2014 · 5 comments

Comments

@Furqankhanzada
Copy link

Below is code what i am using. i checked its creating roles and users and not adding roles field to users.

server/collections/users.js
var users = [
        {name:"Normal User",email:"normal@example.com",roles:[]},
        {name:"View-Secrets User",email:"view@example.com",roles:['view-secrets']},
        {name:"Manage-Users User",email:"manage@example.com",roles:['manage-users']},
        {name:"Admin User",email:"admin@example.com",roles:['admin']}
    ];

    _.each(users, function (user) {
        var id;

        id = Accounts.createUser({
            email: user.email,
            password: "apple1",
            profile: { name: user.name }
        });

        if (user.roles.length > 0) {
            // Need _id of existing user record so this call must come
            // after `Accounts.createUser` or `Accounts.onCreate`
            Roles.addUsersToRoles(id, user.roles);
        }

    });
@alanning
Copy link
Contributor

Hi @Furqankhanzada, It seems to be working for me with a new project and the code you supplied. Viewing the user records in the database after running the app shows the roles being added properly.

Can you put together a public repo up on github that I can check with, please?

@Furqankhanzada
Copy link
Author

@alanning : suddenly its working for me now. i just removed autopublish package. it can be problem ?

@alanning
Copy link
Contributor

Not sure. If you can supply a repro, I can help debug

On Sep 28, 2014, at 4:29 PM, Furqan Khanzada notifications@github.com wrote:

@alanning : suddenly its working for me now. i just removed autopublish package. it can be problem ?


Reply to this email directly or view it on GitHub.

@Furqankhanzada
Copy link
Author

I tried to reproduce it but now its working like charm. will let you know if i found it again. Thanks for your time and great work :)

@alanning
Copy link
Contributor

Glad it's working now! I'll go ahead and close for now but if it comes up again, please put together a repro and re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants