congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ThreadLocalUserContext.getUser
Code IndexAdd Tabnine to your IDE (free)

How to use
getUser
method
in
org.projectforge.framework.persistence.user.api.ThreadLocalUserContext

Best Java code snippets using org.projectforge.framework.persistence.user.api.ThreadLocalUserContext.getUser (Showing top 20 results out of 315)

origin: micromata/projectforge

/**
 * @param rightId
 * @param throwException
 * @see #hasRight(IUserRightId, boolean, UserRightValue...)
 */
@Override
public boolean hasLoggedInUserReadAccess(final IUserRightId rightId, final boolean throwException)
{
 return hasReadAccess(ThreadLocalUserContext.getUser(), rightId, throwException);
}
origin: micromata/projectforge

/**
 * @param dbObj The original object (stored in the database)
 * @param obj
 * @throws AccessException
 */
protected void checkLoggedInUserUpdateAccess(final O obj, final O dbObj) throws AccessException
{
 checkUpdateAccess(ThreadLocalUserContext.getUser(), obj, dbObj);
}
origin: micromata/projectforge

/**
 * @param obj Check access to this object.
 * @return
 * @see #hasLoggedInUserAccess(Object, Object, OperationType, boolean)
 */
public boolean hasLoggedInUserSelectAccess(final O obj, final boolean throwException)
{
 return hasSelectAccess(ThreadLocalUserContext.getUser(), obj, throwException);
}
origin: micromata/projectforge

/**
 * Checks write access of the readWriteUserRight. If not given, true is returned at default. This method should only
 * be used for checking the insert access to show an insert button or not. Before inserting any object the write
 * access is checked by has*Access(...) independent of the result of this method.
 *
 * @see org.projectforge.framework.persistence.api.IDao#hasLoggedInUserInsertAccess()
 */
@Override
public boolean hasLoggedInUserInsertAccess()
{
 return hasInsertAccess(ThreadLocalUserContext.getUser());
}
origin: micromata/projectforge

/**
 * Tests for every group the user is assigned to, if the given permission is given.
 *
 * @return true, if the user owns the required permission, otherwise false.
 */
public boolean hasLoggedInUserPermission(final Integer taskId, final AccessType accessType,
  final OperationType operationType,
  final boolean throwException)
{
 return hasPermission(ThreadLocalUserContext.getUser(), taskId, accessType, operationType, throwException);
}
origin: micromata/projectforge

/**
 * Checks if the user is in one of the given groups. If not, an AccessException will be thrown.
 *
 * @see #isUserMemberOfGroup(ProjectForgeGroup...)
 */
@Override
public void checkIsLoggedInUserMemberOfGroup(final ProjectForgeGroup... groups)
{
 checkIsUserMemberOfGroup(ThreadLocalUserContext.getUser(), groups);
}
origin: micromata/projectforge

/**
 * Checks if the user of the ThreadLocalUserContext (logged in user) is member at least of one of the given groups.
 *
 * @param throwException default false.
 * @param groups
 * @see #isUserMemberOfGroup(PFUserDO, ProjectForgeGroup...)
 */
public boolean isLoggedInUserMemberOfGroup(final boolean throwException, final ProjectForgeGroup... groups)
{
 return isUserMemberOfGroup(ThreadLocalUserContext.getUser(), throwException, groups);
}
origin: micromata/projectforge

/**
 * Is the current context user in at minimum one group of the groups assigned to the given user?
 *
 * @param user
 * @return
 */
public boolean isLoggedInUserInSameGroup(final PFUserDO user)
{
 return areUsersInSameGroup(ThreadLocalUserContext.getUser(), user);
}
origin: micromata/projectforge

@Override
public boolean hasLoggedInUserHistoryAccess(final IUserRightId rightId, final Object obj,
  final boolean throwException)
{
 return hasHistoryAccess(ThreadLocalUserContext.getUser(), rightId, obj, throwException);
}
origin: micromata/projectforge

/**
 * @param parentPage
 * @param data
 */
public SkillRatingEditForm(final SkillRatingEditPage parentPage, final SkillRatingDO data)
{
 super(parentPage, data);
 data.setUser(ThreadLocalUserContext.getUser());
}
origin: micromata/projectforge

 /**
  * @see org.apache.wicket.Component#isVisible()
  */
 @Override
 public boolean isVisible()
 {
  return report != null && StringUtils.isNotBlank(report.getFormattedVacationCount()) && vacationService.couldUserUseVacationService(
    ThreadLocalUserContext.getUser(), false);
 }
}.suppressLabelForWarning();
origin: micromata/projectforge

 /**
  * @see org.apache.wicket.Component#isVisible()
  */
 @Override
 public boolean isVisible()
 {
  return report != null && StringUtils.isNotBlank(report.getFormattedVacationPlandCount()) && vacationService.couldUserUseVacationService(
    ThreadLocalUserContext.getUser(), false);
 }
}.suppressLabelForWarning();
origin: micromata/projectforge

@Override
protected void onSaveOrModify(final MemoDO obj)
{
 super.onSaveOrModify(obj);
 obj.setOwner(ThreadLocalUserContext.getUser()); // Set always the logged-in user as owner.
}
origin: micromata/projectforge

@Override
public boolean isDemoUser()
{
 final PFUserDO user = ThreadLocalUserContext.getUser();
 if (user == null) {
  return false;
 }
 return isDemoUser(user.getId());
}
origin: micromata/projectforge

 @Override
 public boolean isVisible()
 {
  // Is visible if no user is given or the given user is not the current logged in user.
  final PFUserDO user = UserSelectPanel.this.getModelObject();
  return showSelectMeButton == true
    && (user == null || user.getId().equals(ThreadLocalUserContext.getUser().getId()) == false);
 }
};
origin: micromata/projectforge

 /**
  * @see org.apache.wicket.Component#isVisible()
  */
 @Override
 public boolean isVisible()
 {
  // Is visible if no user is given or the given user is not the current logged in user.
  final PFUserDO user = UserSelectPanel.this.getModelObject();
  return showSelectMeButton == true
    && (user == null || user.getId().equals(ThreadLocalUserContext.getUser().getId()) == false);
 }
};
origin: micromata/projectforge

/**
 * @return The locale of the user if exists, otherwise default locale.
 * @see #getUser()
 * @see PFUserDO#getLocale()
 */
public final static Locale getLocale()
{
 final PFUserDO user = getUser();
 return user != null && user.getLocale() != null ? user.getLocale() : getLocale(null);
}
origin: micromata/projectforge

@Override
public void onClick(final AjaxRequestTarget target)
{
 UserSelectPanel.this.setModelObject(ThreadLocalUserContext.getUser());
 markTextFieldModelAsChanged();
 target.add(this, userTextField); // For hiding entry.
}
origin: micromata/projectforge

private void checkAdminUser()
{
 if (Login.getInstance().isAdminUser(ThreadLocalUserContext.getUser()) == false) {
  throw new AccessException(AccessCheckerImpl.I18N_KEY_VIOLATION_USER_NOT_MEMBER_OF,
    ProjectForgeGroup.ADMIN_GROUP.getKey());
 }
}
origin: micromata/projectforge

private UserPrefDO initUserPref(final UserPrefDO userPref, final UserPrefArea area, final Object object)
{
 userPref.setArea(area);
 userPref.setUser(ThreadLocalUserContext.getUser());
 if (object != null) {
  userPrefDao.addUserPrefParameters(userPref, object);
 } else {
  userPrefDao.addUserPrefParameters(userPref, area);
 }
 return userPref;
}
org.projectforge.framework.persistence.user.apiThreadLocalUserContextgetUser

Popular methods of ThreadLocalUserContext

  • getLocalizedString
  • getTimeZone
  • getUserId
  • getLocale
    If context user's locale is null and the given defaultLocale is not null, then the context user's cl
  • getDateTimeZone
  • setUser
    If given user is null, #clear() is called.
  • clear
  • getLocalizedMessage
  • getUserContext
  • setUserContext
  • getCalendarFirstDayOfWeek
    The first day of the week, configured at the given user, if not configured ConfigXml#getFirstDayOfWe
  • getJodaFirstDayOfWeek
  • getCalendarFirstDayOfWeek,
  • getJodaFirstDayOfWeek

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now