Check whether this user can write this node
773922
def check_write_permission(self, user_id, do_raise=True):
        
        return self.get_resource().check_write_permission(user_id, do_raise=do_raise)
1024529
public function can_read() {
        if ($this->is_draft()) {
            return self::can_read_user_draft($this->get('userid'));
        }
        return self::can_read_user($this->get('userid'));
    }
452319
def can_edit(self, user):
        """"""
        return user.is_admin or not self.is_locked and self in user.admin_for
994509
public function canApply()
    {
        $nodeType = $this->getSubject()->getNodeType();

        return $this->getSiblingNode()->getParent()->isNodeTypeAllowedAsChildNode($nodeType);
    }
620833
private boolean isPermissionCheckingEnabled(INode[] pathNodes) {
    if (this.isPermissionEnabled) {
      if (permissionEnabled == null) {
        return false;
      }
      for (INode enableDir : this.permissionEnabled) {
        for (INode pathNode : pathNodes) {
          if (pathNode == enableDir) {
            return true;
          }
        }
      }
      return false;
    }
    return false;
  }
988489
public boolean writable(final Object socketOrChannel)
    {
        final PollItem it = filter(socketOrChannel, WRITABLE);
        if (it == null) {
            return false;
        }
        return it.isWritable();
    }
395534
public function isWritableByCurrentUser()
    {
        if (isset($this->hasWritePermission)) {
            return $this->hasWritePermission;
        }

        // performance improvement, do not detect this in __construct otherwise likely rather "big" query to DB.
        if ($this->hasSiteBeenCreated()) {
            $this->hasWritePermission = Piwik::isUserHasAdminAccess($this->idSite);
        } else {
            $this->hasWritePermission = Piwik::hasUserSuperUserAccess();
        }

        return $this->hasWritePermission;
    }
623288
protected function AllowWriteReview()
    {
        $bAllowWriteReview = false;
        $oModuleConfiguration = $this->GetModuleConfiguration();
        $oUser = TdbDataExtranetUser::GetInstance();
        if ($oModuleConfiguration->fieldAllowWriteReviewLoggedinUsersOnly && $oUser->IsLoggedIn() || !$oModuleConfiguration->fieldAllowWriteReviewLoggedinUsersOnly) {
            $bAllowWriteReview = true;
        }

        return $bAllowWriteReview;
    }
481425
function isWritable(dir) {
	debug('checking if ' + dir + ' is writable');
	try {
		if (!fs.existsSync(dir)) {
			debug(' - it does not exist yet, attempting to create it');
			fs.mkdirSync(dir);
		}
		if (fs.accessSync) {
			fs.accessSync(dir, fs.W_OK);
		} else {
			debug(' - fs.accessSync is not available, falling back to manual write detection');
			fs.writeFileSync(path.join(dir, '.foo'), 'foo');
			assert.equal(fs.readFileSync(path.join(dir, '.foo'), 'UTF-8'), 'foo');
			fs.unlinkSync(path.join(dir, '.foo'));
		}
		debug(' - yes, it is writable');
		return true;
	} catch (exc) {
		debug(' - no, it is not writable: ', exc);
		return false;
	}
}
304073
def write_users(arguments):
    """"""
    import coil.init
    u = coil.utils.ask("Redis URL", "redis://localhost:6379/0")
    return coil.init.write_users(u)
588613
private void handleList(final SecurityContext securityContext, final Writable writable) throws FrameworkException, IOException{

		final Class<NodeInterface> type = StructrApp.getConfiguration().getNodeEntityClass("User");
		final App app                   = StructrApp.getInstance(securityContext);

		if (type != null) {

			try (final Tx tx = app.tx()) {

				final List<NodeInterface> users = app.nodeQuery(type).sort(AbstractNode.name).getAsList();
				for (final Iterator<NodeInterface> it = users.iterator(); it.hasNext();) {

					final NodeInterface user = it.next();
					final String name        = user.getProperty(AbstractNode.name);

					if (name != null) {

						writable.print(name);

					} else {

						writable.print(user.getUuid());
					}

					if (it.hasNext()) {

						writable.print(", ");
					}
				}

				writable.println();

				tx.success();
			}

		} else {

			throw new FrameworkException(422, "Cannot list users, no User class found.");
		}
	}
279155
protected void checkValidForWrite() throws IllegalStateException {
        checkLocked();

        if (state == State.INVALID) {
            throw new IllegalStateException("Not valid for write: session " + this);
        }
        if (state == State.INVALIDATING) {
            return;  // in the process of being invalidated, listeners may try to remove attributes
        }
        if (!isResident()) {
            throw new IllegalStateException("Not valid for write: session " + this);
        }
    }
312725
function writeNode(node, c, end) {
      var toYield = [];
      forEach(simplifyDOM(node, end), function(part) {
        toYield.push(insertPart(part));
      });
      return yield(toYield.join(""), c);
    }
262410
def can_edit(self, user=None, request=None):
        
        can = False
        if request and not self.owner:
            if (getattr(settings, "UMAP_ALLOW_ANONYMOUS", False)
                    and self.is_anonymous_owner(request)):
                can = True
        if self.edit_status == self.ANONYMOUS:
            can = True
        elif not user.is_authenticated:
            pass
        elif user == self.owner:
            can = True
        elif self.edit_status == self.EDITORS and user in self.editors.all():
            can = True
        return can
249433
def checkNode(self, namespaceURI=None, localName=None):
        '''
            
        '''
        namespaceURI = namespaceURI or self.namespaceURI
        localName = localName or self.name
        check = False
        if localName and self.node:
            check = self._dom.isElement(self.node, localName, namespaceURI)
        if not check:
            raise NamespaceError, 'unexpected node type %s, expecting %s' %(self.node, localName)
249791
public static boolean hasNavigableWebContent(
            Context context, AccessibilityNodeInfoCompat node) {
        return (supportsWebActions(node) && isScriptInjectionEnabled(context))
                || hasNativeWebContent(node);
    }
133202
def valid?
      return false if @id.nil?
      return false if @name.nil?
      return false if @name !~ Regexp.new(/^(?!(.*[\\\"\\*\\\\\\>\\<\\?\/\\:\\|]+.*)|(.*[\\.]?.*[\\.]+$)|(.*[ ]+$))/)
      return false if @node_type.nil?
      return false if @is_folder.nil?
      return false if @is_file.nil?
      return false if @modified_at.nil?
      return false if @modified_by_user.nil?
      return false if @created_at.nil?
      return false if @created_by_user.nil?
      return true
    end