Skip to content

Commit

Permalink
#33 Remove attribute "user"
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Nov 20, 2017
1 parent 7c3696b commit d0c2ff1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions app/org/elastic4play/models/Attributes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ object AttributeFormat {

object AttributeOption extends Enumeration with HiveEnumeration {
type Type = Value
val readonly, unaudited, model, form, sensitive, user = Value
val readonly, unaudited, model, form, sensitive = Value
}

case class Attribute[T](
Expand Down Expand Up @@ -88,7 +88,6 @@ case class Attribute[T](
case _: MultiAttributeFormat[_] false
case _ true
}
lazy val isUser: Boolean = options.contains(AttributeOption.user)

def elasticMapping: FieldDefinition = format.elasticType(name) match {
case a: BasicFieldDefinition if isSensitive a.index("no")
Expand Down
1 change: 0 additions & 1 deletion app/org/elastic4play/models/ModelDef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ abstract class ModelAttributes(val name: String) extends AttributeDef {
attr
}

val user = attribute("user", AttributeFormat.stringFmt, "user", None, AttributeOption.readonly, AttributeOption.model)
val createdBy = attribute("createdBy", AttributeFormat.stringFmt, "user who created this entity", None, AttributeOption.model, AttributeOption.readonly)
val createdAt = attribute("createdAt", AttributeFormat.dateFmt, "user who created this entity", new Date, AttributeOption.model, AttributeOption.readonly)
val updatedBy = optionalAttribute("updatedBy", AttributeFormat.stringFmt, "user who created this entity", None, AttributeOption.model)
Expand Down
1 change: 0 additions & 1 deletion app/org/elastic4play/services/CreateSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class CreateSrv @Inject() (
private[services] def addMetaFields(attrs: JsObject)(implicit authContext: AuthContext): JsObject =
attrs ++
Json.obj(
"user" authContext.userId,
"createdBy" authContext.userId,
"createdAt" Json.toJson(new Date))

Expand Down

0 comments on commit d0c2ff1

Please sign in to comment.