<commit_before>var keystone = require('keystone');
var transform = require('model-transform');
var Types = keystone.Field.Types;

var Person = new keystone.List('Person', {
	track: true,
});

Person.add({
	name: { type: Types.Name, required: true, index: true },
	email: { type: Types.Email, initial: true, required: true, index: true },
	password: { type: Types.Password, initial: true, required: true },
}, 'Profile', {
	company: { type: String },
	picture: { type: Types.CloudinaryImage },
	github: { type: String, size: 'small' },
	twitter: { type: String, size: 'small' },
	homepage: { type: Types.Url },
}, 'Permissions', {
	isAdmin: { type: Boolean, label: 'Can access Keystone', index: true },
});

Person.relationship({ ref: 'Talk', refPath: 'person', path: 'talks' });

// Provide access to Keystone
Person.schema.virtual('canAccessKeystone').get(function() {
	return this.isAdmin;
});<commit_msg>Email and Password shouldn't be required for People<commit_after>var keystone = require('keystone');
var transform = require('model-transform');
var Types = keystone.Field.Types;

var Person = new keystone.List('Person', {
	track: true,
});

Person.add({
	name: { type: Types.Name, required: true, index: true },
	email: { type: Types.Email, initial: true, index: true },
	password: { type: Types.Password, initial: true },
}, 'Profile', {
	company: { type: String },
	picture: { type: Types.CloudinaryImage },
	github: { type: String, size: 'small' },
	twitter: { type: String, size: 'small' },
	homepage: { type: Types.Url },
}, 'Permissions', {
	isAdmin: { type: Boolean, label: 'Can access Keystone', index: true },
});

Person.relationship({ ref: 'Talk', refPath: 'person', path: 'talks' });

// Provide access to Keystone
Person.schema.virtual('canAccessKeystone').get(function() {
	return this.isAdmin;
});
{'fraction_non_alphanumeric': 0.17747252747252748, 'fraction_numerical': 0.0, 'mean_word_length': 5.110738255033557, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4285860', 'n_tokens_mistral': 595, 'n_tokens_neox': 576, 'n_words': 169}