 			return user != null
 		p1.then null, (err) ->
 			return false		
-		
-UserSchema.methods =
-	checkPermission: (perm) ->
-		q = @model('Tag').find(name: $in: @tags).exec()
-		q.then (perms) ->
-			_.some perms, (r) ->
-				_.some r.permissions, (p) ->
-					p = new Permission(p)
-					p.implies perm
-	checkPermissions: (perms) ->
-		promises = _.map perms, (p) ->
-			@checkPermission(p)
-		Promise.all(promises).done (permitted) ->
-			_.all permitted
-			
+
 UserSchema.plugin(findOrCreate)
-UserSchema.plugin(taggable)
 UserSchema.plugin(uniqueValidator)
 
 UserSchema.path('url').set (url) ->

RoomSchema.plugin(findOrCreate)
RoomSchema.plugin(taggable)
RoomSchema.plugin(uniqueValidator)

RoomSchema.path('name').set (name) ->
	@jid ?= "#{name}@#{sails.config.xmpp.muc}"

		func(err, res)
				
RoomSchema = new mongoose.Schema
	_id:			{ type: String }
	jid:			{ type: String, required: true, index: {unique: true} }
	name:			{ type: String, required: true, index: {unique: true} }
	privateroom:	{ type: Boolean, default: false }
	createdBy:		{ type: mongoose.Schema.Types.ObjectId, ref: 'User' }
	createdAt:		{ type: Date, default: Date.now }
	updatedBy:		{ type: mongoose.Schema.Types.ObjectId, ref: 'User' }
	updatedAt:		{ type: Date, default: Date.now }
	
RoomSchema.statics =
	search_fields: ->
