blob: 9ac1bfb03277edcaa3dab89a62cd8391b9f4d35d [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*/
import javax.persistence.Cacheable
import javax.persistence.PreUpdate
import ns org.eclipse.osbp.authentication.account.datatypes.BlobImage
import ns org.eclipse.osbp.authentication.account.datatypes.String
import ns org.eclipse.osbp.authentication.account.datatypes.blobtype
import ns org.eclipse.osbp.authentication.account.datatypes.boolean
import ns org.eclipse.osbp.authentication.account.datatypes.int
import ns org.eclipse.osbp.authentication.account.datatypes.StringMandatory
package org.eclipse.osbp.authentication.account.entities {
@Cacheable(false) // disable caching for userdata to allow manipulation of user data via SQL tools
entity UserAccount {
persistenceUnit "authentication"
uuid String id
var unique StringMandatory email group personal
var unique StringMandatory userName group personal
var hidden String password
var String [ regex("[0-9]*") ] extraPassword group personal
ref UserGroup userGroup opposite userAccount group setting
var String position group setting properties(key = "organization" value = "")
var String defaultPerspective group setting properties(key = "perspective" value = "")
var boolean notRegistered group action
var boolean enabled group action
var boolean locked group action
var boolean passwordReset group action
var boolean superuser group personal
var boolean forcePwdChange group action
var int failedAttempt group statistics
var int successfulAttempt group statistics
var hidden int cookieHashCode
var String localeTag group setting properties(key = "i18n" value = "")
var BlobImage profileimage group personal
var String theme group setting properties(key = "theme" value = "")
var String printService group setting properties(key = "printservice" value = "")
var hidden blobtype savedProperties
var hidden blobtype dashBoard
var hidden blobtype favorites
var hidden blobtype filters
@PreUpdate
def void preUpdate() {
if ( locked && ! enabled )
{
locked = false
failedAttempt = 00
}
}
unique index indexUserName {
userName
}
}
entity Filter {
persistenceUnit "authentication"
uuid String id
var String ^filter
var boolean invers
ref UserGroup userGroup opposite userGroupFilter
}
@Cacheable(false) // disable caching for userdata to allow manipulation of user data via SQL tools
entity UserGroup {
persistenceUnit "authentication"
uuid String id
// var UserBean userBean
domainKey unique StringMandatory userGroupName group common
var String position group organization properties(key = "organization" value = "")
var String defaultPerspective group setting properties(key = "perspective" value = "")
var String localeTag group setting properties(key = "i18n" value = "")
var String theme group setting properties(key = "theme" value = "")
var String printService group setting properties(key = "printservice" value = "")
ref UserAccount [*] userAccount opposite userGroup asTable
ref Filter [*] userGroupFilter opposite userGroup
unique index GroupName {
userGroupName
}
}
// bean UserBean {
// var String localeTag properties(key = "i18n" value = "")
// var String theme properties(key = "theme" value = "")
// var String printService properties(key = "printservice" value = "")
// }
}