<commit_before>'use strict';

var mongoose = require('mongoose');
var Defaults    = mongoose.model('_Defaults');
var Prom = require('promise');

module.exports = function () {
	Defaults.find({}).remove ();
	return new Prom (function (resolve, reject) {
		var promiseArray = [];
		//
		// default project permissions
		//
		promiseArray.push ((new Defaults ({
			context  : 'project',
			resource : 'project',
			level    : 'global',
			type     : 'default-permissions',
			defaults : {
				roles: {
					'eao-admin':['eao-admin', 'eao-member', 'eao-invitee', 'epd', 'intake', 'lead', 'team', 'assistant-dm', 'assistant-dm-office', 'associate-dm', 'associate-dmo', 'minister', 'minister-office', 'qa-officer', 'ce-lead', 'ce-officer', 'aboriginal-consultant', 'aboriginal-subconsultant', 'ceaa', 'local-gov', 'working-group', 'technical-working-group'],
					'pro-admin':['pro-admin', 'pro-member', 'pro-subconsultant', 'pro-invitee']
				},
				permissions: {
					'viewSchedule'            : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listEnforcements'        : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'editSchedule'            : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listCommentPeriods'      : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listDocuments'           : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listProjectInvitations'  : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listProjectComplaints'   : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listProjectConditions'   : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listInspectionReports'   : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listProjectRoles'        : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listValuedComponents'    : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listArtifacts'           : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listUsers'               : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'viewEAOTombstone'        : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'uploadDocument'          : ['eao-admin',               'pro-admin', 'pro-member'],
					'createProjectInvitation' : ['eao-admin',               'pro-admin', 'pro-member'],
					'createProjectRole'       : ['eao-admin',               'pro-admin', 'pro-member'],
					'createValuedComponent'   : ['eao-admin',               'pro-admin', 'pro-member'],
					'createArtifact'          : ['eao-admin',               'pro-admin', 'pro-member'],
					'editProject'             : ['eao-admin',               'pro-admin', 'pro-member'],
					'createEnforcement'       : ['eao-admin'                                         ],
					'createCommentPeriod'     : ['eao-admin'                                         ],
					'createProjectComplaint'  : ['eao-admin'                                         ],
					'createProjectCondition'  : ['eao-admin'                                         ],
					'createInspectionReport'  : ['eao-admin'                                         ],
					'publish'                 : ['eao-admin'                                         ],
					'unPublish'               : ['eao-admin'                                         ],
				}
			}
		})).save ());
		//
		// default application permissions
		//
		promiseArray.push ((new Defaults ({
			context  : 'application',
			resource : 'application',
			level    : 'global',
			type     : 'default-permissions',
			//
			// this goes owner, role, permissions
			//
			defaults : {
				roles: {
					'application:sysadmin':['sysadmin', 'eao', 'proponent', 'invitee']
				},
				permissions: {
					'viewConfiguration'   : ['sysadmin','proponent','eao'],
					'viewSchedule'        : ['sysadmin','proponent','eao'],
					'listConditions'      : ['sysadmin','proponent','eao'],
					'listEmailTemplates'  : ['sysadmin','proponent','eao'],
					'listOrganizations'   : ['sysadmin','proponent','eao'],
					'listNews'            : ['sysadmin','proponent','eao'],
					'listRoles'           : ['sysadmin','proponent','eao'],
					'listTemplates'       : ['sysadmin','proponent','eao'],
					'listTopics'          : ['sysadmin','proponent','eao'],
					'listUsers'           : ['sysadmin','proponent','eao'],
					'createProject'       : ['sysadmin','proponent'],
					'createCondition'     : ['sysadmin'],<commit_msg>Adding initial set of see data for document resource.<commit_after>'use strict';

var mongoose = require('mongoose');
var Defaults    = mongoose.model('_Defaults');
var Prom = require('promise');

module.exports = function () {
	Defaults.find({}).remove ();
	return new Prom (function (resolve, reject) {
		var promiseArray = [];
		//
		// default project permissions
		//
		promiseArray.push ((new Defaults ({
			context  : 'project',
			resource : 'project',
			level    : 'global',
			type     : 'default-permissions',
			defaults : {
				roles: {
					'eao-admin':['eao-admin', 'eao-member', 'eao-invitee', 'epd', 'intake', 'lead', 'team', 'assistant-dm', 'assistant-dm-office', 'associate-dm', 'associate-dmo', 'minister', 'minister-office', 'qa-officer', 'ce-lead', 'ce-officer', 'aboriginal-consultant', 'aboriginal-subconsultant', 'ceaa', 'local-gov', 'working-group', 'technical-working-group'],
					'pro-admin':['pro-admin', 'pro-member', 'pro-subconsultant', 'pro-invitee']
				},
				permissions: {
					'viewSchedule'            : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listEnforcements'        : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'editSchedule'            : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listCommentPeriods'      : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listDocuments'           : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listProjectInvitations'  : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listProjectComplaints'   : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listProjectConditions'   : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listInspectionReports'   : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listProjectRoles'        : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listValuedComponents'    : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listArtifacts'           : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'listUsers'               : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'viewEAOTombstone'        : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'uploadDocument'          : ['eao-admin',               'pro-admin', 'pro-member'],
					'createProjectInvitation' : ['eao-admin',               'pro-admin', 'pro-member'],
					'createProjectRole'       : ['eao-admin',               'pro-admin', 'pro-member'],
					'createValuedComponent'   : ['eao-admin',               'pro-admin', 'pro-member'],
					'createArtifact'          : ['eao-admin',               'pro-admin', 'pro-member'],
					'editProject'             : ['eao-admin',               'pro-admin', 'pro-member'],
					'createEnforcement'       : ['eao-admin'                                         ],
					'createCommentPeriod'     : ['eao-admin'                                         ],
					'createProjectComplaint'  : ['eao-admin'                                         ],
					'createProjectCondition'  : ['eao-admin'                                         ],
					'createInspectionReport'  : ['eao-admin'                                         ],
					'publish'                 : ['eao-admin'                                         ],
					'unPublish'               : ['eao-admin'                                         ],
				}
			}
		})).save ());
		//
		// default document permissions
		//
		promiseArray.push ((new Defaults ({
			context  : 'project',
			resource : 'document',
			level    : 'global',
			type     : 'default-permissions',
			defaults : {
				roles: {
					'eao-admin':['eao-admin', 'eao-member', 'eao-invitee', 'epd', 'intake', 'lead', 'team', 'assistant-dm', 'assistant-dm-office', 'associate-dm', 'associate-dmo', 'minister', 'minister-office', 'qa-officer', 'ce-lead', 'ce-officer', 'aboriginal-consultant', 'aboriginal-subconsultant', 'ceaa', 'local-gov', 'working-group', 'technical-working-group'],
					'pro-admin':['pro-admin', 'pro-member', 'pro-subconsultant', 'pro-invitee']
				},
				permissions: {
					'listDocuments'           : ['eao-admin', 'eao-member', 'pro-admin', 'pro-member'],
					'uploadDocument'          : ['eao-admin',               'pro-admin', 'pro-member'],
					'createArtifact'          : ['eao-admin',               'pro-admin', 'pro-member'],
					'publish'                 : ['eao-admin'                                         ],
					'unPublish'               : ['eao-admin'                                         ],
				}
			}
		})).save ());
		//
		// default application permissions
		//
		promiseArray.push ((new Defaults ({
			context  : 'application',
			resource : 'application',
			level    : 'global',
			type     : 'default-permissions',
			//
			// this goes owner, role, permissions
			//
			defaults : {
				roles: {
					'application:sysadmin':['sysadmin', 'eao', 'proponent', 'invitee']
				},
				permissions: {
					'viewConfiguration'   : ['sysadmin','proponent','eao'],
					'viewSchedule'        : ['sysadmin','proponent','eao'],
					'listConditions'      : ['sysadmin','proponent','eao'],
					'listEmailTemplates'  : ['sysadmin','proponent','eao'],
					'listOrganizations'   : ['sysadmin','proponent','eao'],
					'listNews'            : ['sysadmin','proponent','eao'],
					'listRoles'           : ['sysadmin','proponent','eao'],
					'listTemplates'       : ['sysadmin','proponent','eao'],
					'listTopics'          : ['sysadmin','proponent','eao'],
					'listUsers'           : ['sysadmin','proponent','eao'],
					'createProject'       : ['sysadmin','proponent'],
					'createCondition'     : ['sysadmin'],
{'fraction_non_alphanumeric': 0.19632685130622668, 'fraction_numerical': 0.0, 'mean_word_length': 2.2388676844783717, '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': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1754484', 'n_tokens_mistral': 3677, 'n_tokens_neox': 3150, 'n_words': 516}