Rev 1782 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
75 | jmachado | 1 | package pt.estgp.estgweb.domain; |
2 | |||
146 | jmachado | 3 | import java.io.Serializable; |
4 | import java.util.List; |
||
5 | |||
75 | jmachado | 6 | /** |
7 | * @author Jorge Machado |
||
8 | * @date 21/Abr/2008 |
||
9 | * @time 14:38:08 |
||
10 | * @see pt.estgp.estgweb.domain |
||
11 | */ |
||
202 | jmachado | 12 | public class BlogPostImpl extends BlogPost implements IOwned, IValid, IInternal, ICanLoad |
75 | jmachado | 13 | { |
146 | jmachado | 14 | public 1.5.0/docs/api/java/io/Serializable.html">Serializable getSerializable() |
15 | { |
||
16 | return getId(); |
||
17 | } |
||
18 | |||
201 | jmachado | 19 | /** |
20 | * Not implemeted |
||
21 | * @return null |
||
22 | */ |
||
146 | jmachado | 23 | public List<String> getOwnerRoles() |
24 | { |
||
25 | return null; |
||
26 | } |
||
201 | jmachado | 27 | |
28 | /** |
||
214 | jmachado | 29 | * Not implemented |
30 | */ |
||
201 | jmachado | 31 | public 1.5.0/docs/api/java/lang/String.html">String getChoosedOwnerRole() |
32 | { |
||
33 | return null; |
||
34 | } |
||
35 | |||
36 | public boolean isValid() |
||
37 | { |
||
38 | return isStatus(); |
||
39 | } |
||
40 | |||
41 | public boolean isInternal() |
||
42 | { |
||
43 | return getBlog().isInternal(); |
||
44 | } |
||
202 | jmachado | 45 | |
46 | public boolean canLoad(GenericUserImpl u) |
||
47 | { |
||
1782 | jmachado | 48 | return isStatus() || checkIsOwnedBy(u) || (u != null && u.isSuperuserOrAdmin()); |
202 | jmachado | 49 | } |
50 | |||
51 | public boolean canLoadInOpenTransaction(GenericUserImpl u) |
||
52 | { |
||
205 | jmachado | 53 | return canLoad(u); |
202 | jmachado | 54 | } |
205 | jmachado | 55 | |
1782 | jmachado | 56 | public boolean checkIsOwnedBy(GenericUser u) |
205 | jmachado | 57 | { |
1782 | jmachado | 58 | return checkIsOwnedBy(u, false); |
205 | jmachado | 59 | } |
208 | jmachado | 60 | |
1782 | jmachado | 61 | public boolean checkIsOwnedBy(GenericUser u, boolean transaction) |
208 | jmachado | 62 | { |
1782 | jmachado | 63 | return super.checkIsOwnedBy(u, transaction) || getBlog().checkIsOwnedBy(u, transaction); |
208 | jmachado | 64 | } |
75 | jmachado | 65 | } |