mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
55 lines
775 B
JavaScript
55 lines
775 B
JavaScript
/*
|
|
|
|
The main Movies collection definition file.
|
|
|
|
*/
|
|
|
|
import { createCollection, getDefaultResolvers, getDefaultMutations } from 'meteor/vulcan:core';
|
|
import Users from 'meteor/vulcan:users';
|
|
import schema from './schema.js';
|
|
|
|
/*
|
|
|
|
Movies collection definition
|
|
|
|
*/
|
|
const Movies = createCollection({
|
|
|
|
collectionName: 'Movies',
|
|
|
|
typeName: 'Movie',
|
|
|
|
schema,
|
|
|
|
resolvers: getDefaultResolvers('Movies'),
|
|
|
|
mutations: getDefaultMutations('Movies'),
|
|
|
|
});
|
|
|
|
/*
|
|
|
|
Permissions for members (regular users)
|
|
|
|
*/
|
|
const membersActions = [
|
|
'movies.new',
|
|
'movies.edit.own',
|
|
'movies.remove.own',
|
|
];
|
|
Users.groups.members.can(membersActions);
|
|
|
|
/*
|
|
|
|
Default sort
|
|
|
|
*/
|
|
Movies.addDefaultView(terms => ({
|
|
options: {
|
|
sort: {
|
|
createdAt: -1
|
|
}
|
|
}
|
|
}));
|
|
|
|
export default Movies;
|