Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
919 | dev | 1 | package ak.hostcaptain.core.model; |
2 | |||
3 | /** |
||
4 | * |
||
5 | * @hibernate.class table="domains" |
||
6 | */ |
||
7 | public class InetDomain |
||
8 | extends GeneralModelObject |
||
9 | { |
||
10 | private Long id; |
||
11 | private String name; |
||
12 | private User owner; |
||
13 | |||
14 | protected InetDomain() |
||
15 | { |
||
16 | } |
||
17 | |||
18 | /** |
||
19 | * |
||
20 | * @hibernate.id generator-class="native" |
||
21 | */ |
||
22 | public Long getId() |
||
23 | { |
||
24 | return id; |
||
25 | } |
||
26 | |||
27 | public void setId(Long id) |
||
28 | { |
||
29 | this.id = id; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * |
||
34 | * @hibernate.property |
||
35 | */ |
||
36 | public String getName() |
||
37 | { |
||
38 | return name; |
||
39 | } |
||
40 | |||
41 | public void setName(String name) |
||
42 | { |
||
43 | this.name = name; |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * |
||
48 | * @hibernate.many-to-one |
||
49 | */ |
||
50 | public User getOwner() |
||
51 | { |
||
52 | return owner; |
||
53 | } |
||
54 | |||
55 | public void setOwner(User owner) |
||
56 | { |
||
57 | this.owner = owner; |
||
58 | } |
||
59 | |||
60 | public String getTypeKey() |
||
61 | { |
||
62 | return ak.hostcaptain.core.CoreResources.TYPE_DOMAIN; |
||
63 | } |
||
64 | |||
65 | public String getIdentKey() |
||
66 | { |
||
67 | return ak.hostcaptain.core.CoreResources.IDENT_DOMAIN; |
||
68 | } |
||
69 | |||
70 | public Object[] getIdentParams() |
||
71 | { |
||
72 | return new Object[] { getName() }; |
||
73 | } |
||
74 | |||
75 | public boolean viewableBy(User user) |
||
76 | { |
||
77 | return user.isSuperuser() || user.equals(owner); |
||
78 | } |
||
79 | |||
80 | public boolean editableBy(User user) |
||
81 | { |
||
82 | return user.isSuperuser(); |
||
83 | } |
||
84 | |||
85 | public boolean deleteableBy(User user) |
||
86 | { |
||
87 | return user.isSuperuser(); |
||
88 | } |
||
89 | } |