<commit_before>var Base = require('./base.js').Base;
var util = require("util"), crypto = require('crypto');
var settings = require('../settings.js');
var validator = require('../libs/schemas/validator');
var models = require('../models');
var async = require('async');

function Event() {
	this._attributs = {
		approved : [],
		disapproved : [],
		agenda : null,
		event : null,
		author : null,
		writeGroups : null,
		readGroups : null,
		writeUsers : null,
		readUsers : null,
		computedWriteUsers : [],
		computedWriteGroups : [],
		computedReadUsers : [],
		computedReadGroups : [],
		computedWriteUsersPerms : [],
		computedWriteGroupsPerms : [],
		computedReadUsersPerms : [],
		computedReadGroupsPerms : [],
		approvedBy : [],
		disapprovedBy : []
	};
	Base.call(this, 'event');

	this.initialData = {
		agenda : null,
		parentEvent : null
	}

}

util.inherits(Event, Base);

Event.publicAttributes = Base.publicAttributes.concat(['event', 'author', 'writeGroups', 'readGroups', 'writeUsers', 'readUsers', 'agenda']);
Event.staffAttributes = Event.publicAttributes.concat(Base.staffAttributes);
Event.metaAttributes = ['event'];

Event.publicWriteAttributes = ['event', 'agenda'];
Event.staffWriteAttributes = Event.publicWriteAttributes;

Event.prototype.hasPerm = function(perm, user, callback) {

	switch (perm) {
		case 'read':
			callback(null, this.hasReadPerm(user));
			break;

		case 'create':<commit_msg>update event<commit_after>var Base = require('./base.js').Base;
var util = require("util"), crypto = require('crypto');
var settings = require('../settings.js');
var validator = require('../libs/schemas/validator');
var models = require('../models');
var async = require('async');

function Event() {
	this._attributs = {
		//approved : [],
		//disapproved : [],
		agenda : null,
		event : null,
		author : null,
		writeGroups : null,
		readGroups : null,
		writeUsers : null,
		readUsers : null,
		computedWriteUsers : [],
		computedWriteGroups : [],
		computedReadUsers : [],
		computedReadGroups : [],
		computedWriteUsersPerms : [],
		computedWriteGroupsPerms : [],
		computedReadUsersPerms : [],
		computedReadGroupsPerms : [],
		approvedBy : [],
		disapprovedBy : []
	};
	Base.call(this, 'event');

	this.initialData = {
		agenda : null,
		parentEvent : null
	}

}

util.inherits(Event, Base);

Event.publicAttributes = Base.publicAttributes.concat(['event', 'author', 'writeGroups', 'readGroups', 'writeUsers', 'readUsers', 'agenda', 'approvedBy', 'disapprovedBy' ]);
Event.staffAttributes = Event.publicAttributes.concat(Base.staffAttributes);
Event.metaAttributes = ['event'];

Event.publicWriteAttributes = ['event', 'agenda'];
Event.staffWriteAttributes = Event.publicWriteAttributes;

Event.prototype.hasPerm = function(perm, user, callback) {

	switch (perm) {
		case 'read':
			callback(null, this.hasReadPerm(user));
			break;

		case 'create':
{'fraction_non_alphanumeric': 0.16510579257717656, 'fraction_numerical': 0.0, 'mean_word_length': 4.802816901408451, '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': '6669296', 'n_tokens_mistral': 957, 'n_tokens_neox': 884, 'n_words': 178}