Similar to {@link #checkPermission()}, but it allows the AppInfoDialog will be enabled or disabled for this call.

@param showAppInfoDialogEnabled true if the AppInfoDialog is enabled, false to disabled it.
514960
public boolean checkPermission(boolean showAppInfoDialogEnabled) {
		boolean hasPermission;
		if (permissionRationaleMessageResId != 0) {
			hasPermission = checkPermission(permissionDelegate, getPermissionRationaleTitleResId(), permissionRationaleMessageResId, permission, permissionRequestCode);
		} else {
			hasPermission = checkPermission(permissionDelegate, permission, permissionRequestCode);
		}
		if (!hasPermission && showAppInfoDialogEnabled) {
			previouslyShouldShowRequestPermissionRationale = permissionDelegate.shouldShowRequestPermissionRationale(permission);
		} else {
			previouslyShouldShowRequestPermissionRationale = null;
		}
		return hasPermission;
	}
531392
public static boolean getCurrentSecurityEnabled()
  {
      boolean enabled = false;
      ICollaboratorHelper instance = getCurrentInstance();
      if (instance != null)
          enabled = ((CollaboratorHelperImpl)instance).isSecurityEnabled();
      return enabled;
  }
333182
private void enableSetButton(boolean enabled) {

        if (enabled) {
            if (m_addPermissionSetButton == null) {
                m_addPermissionSetButton = new Button(FontAwesome.PLUS);
                m_addPermissionSetButton.addStyleName(OpenCmsTheme.BUTTON_ICON);
                m_addPermissionSetButton.addClickListener(new ClickListener() {

                    private static final long serialVersionUID = 1L;

                    public void buttonClick(ClickEvent event) {

                        onSelect();
                    }
                });
                m_main.addComponent(m_addPermissionSetButton);
            }
        } else if (m_addPermissionSetButton != null) {
            m_main.removeComponent(m_addPermissionSetButton);
            m_addPermissionSetButton = null;
        }
    }
1224900
private boolean isValidUserAccess(UserDefinition userDef, Permission permNeeded) {
        Set<Permission> permList = userDef.getPermissions();
        if (permList.size() == 0 || permList.contains(Permission.ALL)) {
            return true;
        }
        switch (permNeeded) {
        case APPEND:
            return permList.contains(Permission.APPEND) || permList.contains(Permission.UPDATE);
        case READ:
            return permList.contains(Permission.READ);
        case UPDATE:
            return permList.contains(Permission.UPDATE);
        default:
            return false;
        }
    }
577867
public boolean isAccessDenied(final String viewName) {
        final List<DashboardMenuItem> accessibleViews = getAccessibleViews();
        boolean accessDeined = Boolean.TRUE.booleanValue();
        for (final DashboardMenuItem dashboardViewType : accessibleViews) {
            if (dashboardViewType.getViewName().equals(viewName)) {
                accessDeined = Boolean.FALSE.booleanValue();
            }
        }
        return accessDeined;
    }
900843
public void setHideDisabled(final boolean hideDisabled) {
        if (hideDisabled)
            attrMixin.setAttribute(HIDE_DISABLED, Boolean.toString(true));
        else
            attrMixin.removeAttribute(HIDE_DISABLED);
    }
665448
public boolean isPermissionDeclined(@NonNull String permissionsName) {
        return ActivityCompat.checkSelfPermission(context, permissionsName) != PackageManager.PERMISSION_GRANTED;
    }
1195333
private void callbackSucceed() {
        if (mGranted != null) {
            List<String> permissionList = asList(mPermissions);
            try {
                mGranted.onAction(permissionList);
            } catch (Exception e) {
                Log.e("AndPermission", "Please check the onGranted() method body for bugs.", e);
                if (mDenied != null) {
                    mDenied.onAction(permissionList);
                }
            }
        }
    }
191977
private void setConditionEnabled(boolean enabled)
	{
		fConditionEditor.setEnabled(enabled);
		fSuspendWhenLabel.setEnabled(enabled);
		fConditionIsTrue.setEnabled(enabled);
		fConditionHasChanged.setEnabled(enabled);
	}
1234735
@Override
	public synchronized boolean checkPermission(Principal principal, Permission permission)
	{

		if (principal == null)
			return false;

		if (permission == null)
			return false;

		Set<AccessControl> set = this.entries.get(principal);

		if (set != null && !set.isEmpty())
		{
			for (AccessControl accessControl: set)
			{
				if (accessControl.checkPermission(permission))
					return true;
			}
		}

		// did not find for user, not check for groups
		if (SecurityUser.class.isAssignableFrom(principal.getClass()))
		{
			return checkPermission(((SecurityUser) principal).getGroups(), permission);
		}
		return false;
	}
514026
private boolean isPermissionGranted(String permission) {
        if (permission == null) {
            throw new IllegalArgumentException("permission is null");
        }

        return context.checkPermission(permission, android.os.Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED;
    }
782305
public final void checkPermission(@Nonnull Permission p) {
        Authentication a = Jenkins.getAuthentication();
        if (a == SYSTEM) {
            return;
        }
        if(!hasPermission(a,p))
            throw new AccessDeniedException2(a,p);
    }
1264062
public static boolean hasAllPermission(@NonNull Fragment context, @NonNull String... permissions) {
        if (Build.VERSION.SDK_INT < 23) {
            return true;
        } else {
            for (String permission : permissions) {
                if (ContextCompat.checkSelfPermission(context.getContext(), permission) != PackageManager.PERMISSION_GRANTED) {
                    return false;
                }
            }
            return true;
        }
    }
72428
private void showPopupUnchecked(int maxActivityCount) {
        if (mAdapter.getDataModel() == null) {
            throw new IllegalStateException("No data model. Did you call #setDataModel?");
        }

        getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener);

        final boolean defaultActivityButtonShown =
            mDefaultActivityButton.getVisibility() == VISIBLE;

        final int activityCount = mAdapter.getActivityCount();
        final int maxActivityCountOffset = defaultActivityButtonShown ? 1 : 0;
        if (maxActivityCount != ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED
                && activityCount > maxActivityCount + maxActivityCountOffset) {
            mAdapter.setShowFooterView(true);
            mAdapter.setMaxActivityCount(maxActivityCount - 1);
        } else {
            mAdapter.setShowFooterView(false);
            mAdapter.setMaxActivityCount(maxActivityCount);
        }

        IcsListPopupWindow popupWindow = getListPopupWindow();
        if (!popupWindow.isShowing()) {
            if (mIsSelectingDefaultActivity || !defaultActivityButtonShown) {
                mAdapter.setShowDefaultActivity(true, defaultActivityButtonShown);
            } else {
                mAdapter.setShowDefaultActivity(false, false);
            }
            final int contentWidth = Math.min(mAdapter.measureContentWidth(), mListPopupMaxWidth);
            popupWindow.setContentWidth(contentWidth);
            popupWindow.show();
            if (mProvider != null) {
                mProvider.subUiVisibilityChanged(true);
            }
            popupWindow.getListView().setContentDescription(mContext.getString(
                    R.string.abs__activitychooserview_choose_application));
        }
    }
793970
@Programmatic
    public ApplicationPermission newPermission(
            final ApplicationRole role,
            final ApplicationPermissionRule rule,
            final ApplicationPermissionMode mode,
            final ApplicationFeatureType featureType,
            final String featureFqn) {
        final ApplicationFeatureId featureId = ApplicationFeatureId.newFeature(featureType, featureFqn);
        final ApplicationFeature feature = applicationFeatureRepository.findFeature(featureId);
        if(feature == null) {
            container.warnUser("No such " + featureType.name().toLowerCase() + ": " + featureFqn);
            return null;
        }
        return newPermissionNoCheck(role, rule, mode, featureType, featureFqn);
    }
110663
public void checkPermission(Permission perm, AddOnModel addOnModel) throws IzouPermissionException {
        try {
            rootPermission.checkPermission(perm, addOnModel);
            //its root
            return;
        } catch (IzouPermissionException ignored) {
            //its just not root
        }
        standardCheck.stream()
                .filter(permissionModule -> permissionModule.canCheckPermission(perm))
                .forEach(permissionModule -> permissionModule.checkPermission(perm, addOnModel));
    }
681642
protected void checkPermissionsForMassEdit(CmsObject cms) throws CmsException {

        OpenCms.getRoleManager().checkRoleForResource(cms, CmsRole.ADMINISTRATOR, "/");
    }