1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.model.common;
|
11
|
|
12
|
import javax.persistence.Entity;
|
13
|
import javax.xml.bind.annotation.XmlAccessType;
|
14
|
import javax.xml.bind.annotation.XmlAccessorType;
|
15
|
import javax.xml.bind.annotation.XmlElement;
|
16
|
import javax.xml.bind.annotation.XmlRootElement;
|
17
|
import javax.xml.bind.annotation.XmlType;
|
18
|
|
19
|
import org.hibernate.annotations.NaturalId;
|
20
|
import org.springframework.security.core.GrantedAuthority;
|
21
|
|
22
|
@XmlAccessorType(XmlAccessType.FIELD)
|
23
|
@XmlType(name = "GrantedAuthority", propOrder = {
|
24
|
"authority"
|
25
|
})
|
26
|
@XmlRootElement(name = "Group")
|
27
|
@Entity
|
28
|
public class GrantedAuthorityImpl extends CdmBase implements GrantedAuthority {
|
29
|
|
30
|
/**
|
31
|
*
|
32
|
*/
|
33
|
private static final long serialVersionUID = 2651969425860655040L;
|
34
|
|
35
|
@XmlElement(name = "Authority")
|
36
|
@NaturalId
|
37
|
private String authority;
|
38
|
|
39
|
public String getAuthority() {
|
40
|
return authority;
|
41
|
}
|
42
|
|
43
|
public void setAuthority(String authority) {
|
44
|
this.authority = authority;
|
45
|
}
|
46
|
|
47
|
public int compareTo(Object o) {
|
48
|
if(o instanceof GrantedAuthority) {
|
49
|
return this.authority.compareTo(((GrantedAuthority)o).getAuthority());
|
50
|
}
|
51
|
return 0;
|
52
|
}
|
53
|
}
|