BrightSide Workbench Full Report + Source Code
org.turro.marker.ContactIdentity Class Reference

Public Member Functions

boolean isAppAdministrator ()
 
boolean isContactAdministrator ()
 
boolean isDossierAdministrator ()
 
boolean isWebapp ()
 
boolean isUserMenu ()
 
boolean isMember (String identity)
 
boolean isContactLogged ()
 
boolean isInRole (String role)
 
boolean isMe (IContact contact)
 
String getAvatar ()
 
IProfile getProfile ()
 
String getName ()
 
String getEmail ()
 
String getPhone ()
 
IContact getContact ()
 
PermissionMap getPermissionMap ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 33 of file ContactIdentity.java.

Member Function Documentation

◆ getAvatar()

String org.turro.marker.ContactIdentity.getAvatar ( )

Definition at line 77 of file ContactIdentity.java.

77  {
78  IContact logged = (IContact) Application.getUser();
79  if(logged != null && logged.isValid()) {
80  File favatar = new File(ElephantContext.getRealPath("/_internal/files/contact/" + logged.getId() + "/profile/face.png"));
81  if(favatar.exists()) {
82  return ElephantContext.getRootWebPath() + "/_internal/files/contact/" + logged.getId() + "/profile/face.png";
83  }
84  }
85  return null;
86  }
Here is the call graph for this function:

◆ getContact()

IContact org.turro.marker.ContactIdentity.getContact ( )

Definition at line 108 of file ContactIdentity.java.

108  {
109  IContact logged = (IContact) Application.getUser();
110  return logged != null && logged.isValid() ? logged : null;
111  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEmail()

String org.turro.marker.ContactIdentity.getEmail ( )

Definition at line 98 of file ContactIdentity.java.

98  {
99  IContact logged = (IContact) Application.getUser();
100  return logged != null && logged.isValid() ? logged.getEmail() : null;
101  }
Here is the call graph for this function:

◆ getName()

String org.turro.marker.ContactIdentity.getName ( )

Definition at line 93 of file ContactIdentity.java.

93  {
94  IContact logged = (IContact) Application.getUser();
95  return logged != null && logged.isValid() ? logged.getName() : null;
96  }
Here is the call graph for this function:

◆ getPermissionMap()

PermissionMap org.turro.marker.ContactIdentity.getPermissionMap ( )

Definition at line 115 of file ContactIdentity.java.

115  {
116  IContact contact = getContact();
117  return contact != null ? contact.getPermissions().asMap() : EMPTY_PERMISSIONS;
118  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPhone()

String org.turro.marker.ContactIdentity.getPhone ( )

Definition at line 103 of file ContactIdentity.java.

103  {
104  IContact logged = (IContact) Application.getUser();
105  return logged != null && logged.isValid() ? logged.getProfile().getPhone() : null;
106  }
Here is the call graph for this function:

◆ getProfile()

IProfile org.turro.marker.ContactIdentity.getProfile ( )

Definition at line 88 of file ContactIdentity.java.

88  {
89  IContact logged = (IContact) Application.getUser();
90  return logged != null && logged.isValid() ? logged.getProfile() : null;
91  }
Here is the call graph for this function:

◆ isAppAdministrator()

boolean org.turro.marker.ContactIdentity.isAppAdministrator ( )

Definition at line 35 of file ContactIdentity.java.

35  {
36  return isContactAdministrator();
37  }
Here is the call graph for this function:

◆ isContactAdministrator()

boolean org.turro.marker.ContactIdentity.isContactAdministrator ( )

Definition at line 39 of file ContactIdentity.java.

39  {
40  return Application.getApplication().isInRole("contact:all");
41  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isContactLogged()

boolean org.turro.marker.ContactIdentity.isContactLogged ( )

Definition at line 61 of file ContactIdentity.java.

61  {
62  return Application.getApplication().isInRole("user:in");
63  }
Here is the call graph for this function:

◆ isDossierAdministrator()

boolean org.turro.marker.ContactIdentity.isDossierAdministrator ( )

Definition at line 43 of file ContactIdentity.java.

43  {
44  return Application.getApplication().isInRole("dossier:all");
45  }
Here is the call graph for this function:

◆ isInRole()

boolean org.turro.marker.ContactIdentity.isInRole ( String  role)

Definition at line 65 of file ContactIdentity.java.

65  {
66  return Application.getApplication().isInRole(role);
67  }
Here is the call graph for this function:

◆ isMe()

boolean org.turro.marker.ContactIdentity.isMe ( IContact  contact)

Definition at line 69 of file ContactIdentity.java.

69  {
70  IContact logged = (IContact) Application.getUser();
71  if(logged != null && logged.isValid() && contact != null && contact.isValid()) {
72  return logged.getId().equals(contact.getId());
73  }
74  return false;
75  }
Here is the call graph for this function:

◆ isMember()

boolean org.turro.marker.ContactIdentity.isMember ( String  identity)

Definition at line 57 of file ContactIdentity.java.

57  {
58  return Application.getApplication().isInRole(identity + ":member");
59  }
Here is the call graph for this function:

◆ isUserMenu()

boolean org.turro.marker.ContactIdentity.isUserMenu ( )

Definition at line 52 of file ContactIdentity.java.

52  {
53  IContact logged = (IContact) Application.getUser();
54  return logged != null && logged.isValid() && logged.isUserMenu();
55  }
Here is the call graph for this function:

◆ isWebapp()

boolean org.turro.marker.ContactIdentity.isWebapp ( )

Definition at line 47 of file ContactIdentity.java.

47  {
48  IContact logged = (IContact) Application.getUser();
49  return logged != null && logged.isValid() && logged.isWebapp();
50  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: