My site allows users to apply by connecting their google account, as soon as the account is created, they are given a "pending" role (using alanning: roles ). I would like to have a table for administrators to see when new applicants apply, from there the administrator can correctly manage the user's application (change role accepted, rejected, etc.). So, I created my table, but it shows all the users, I wonder if anyone knows a way to make sure that only users with a "waiting" role are shown in my table?
Here is what I still have:
TabularTables.ManageApplications = new Tabular.Table({
name: 'ManageApplications',
collection: Meteor.users,
allow: function (userId) {
return Roles.userIsInRole(userId, 'admin');
},
autoWidth: false,
oLanguage: {
"sSearch": "Search: "
},
columns: [
{ data:
{ data:
{ data:
{ data:
{ data:
],
});
, ( "" ).
, :
Meteor.publish("pendingUsers", function() {
var isAdmin = Roles.userIsInRole(this.userId, 'admin');
if (isAdmin) {
return Roles.getUsersInRole('pending').fetch();
} else {
return null;
}
});
, pub: "pendingUsers", . , "" , - , .
- , , , , ... , " " readme, , . .