/** * @return the owning group actions */ public AclActions getOwningGroupActions() { return Mode.extractGroupBits(mMode).toAclActions(); }
@Override public String toString() { if (mSrcInode != null) { short mode = mSrcInode.getMode(); return String.format( "succeeded=%b\tallowed=%b\tugi=%s (AUTH=%s)\tip=%s\tcmd=%s\tsrc=%s\tdst=%s\t" + "perm=%s:%s:%s%s%s", mSucceeded, mAllowed, mUgi, mAuthType, mIp, mCommand, mSrcPath, mDstPath, mSrcInode.getOwner(), mSrcInode.getGroup(), Mode.extractOwnerBits(mode), Mode.extractGroupBits(mode), Mode.extractOtherBits(mode)); } else { return String.format( "succeeded=%b\tallowed=%b\tugi=%s (AUTH=%s)\tip=%s\tcmd=%s\tsrc=%s\tdst=%s\t" + "perm=null", mSucceeded, mAllowed, mUgi, mAuthType, mIp, mCommand, mSrcPath, mDstPath); } } }
@Override public Mode.Bits getPermission(String user, List<String> groups, Inode<?> inode) { short mode = inode.getMode(); if (user.equals(inode.getOwner())) { return Mode.extractOwnerBits(mode); } if (groups.contains(inode.getGroup())) { return Mode.extractGroupBits(mode); } return Mode.extractOtherBits(mode); } }
@Override public String toString() { if (mSrcInode != null) { short mode = mSrcInode.getMode(); return String.format( "succeeded=%b\tallowed=%b\tugi=%s (AUTH=%s)\tip=%s\tcmd=%s\tsrc=%s\tdst=%s\t" + "perm=%s:%s:%s%s%s", mSucceeded, mAllowed, mUgi, mAuthType, mIp, mCommand, mSrcPath, mDstPath, mSrcInode.getOwner(), mSrcInode.getGroup(), Mode.extractOwnerBits(mode), Mode.extractGroupBits(mode), Mode.extractOtherBits(mode)); } else { return String.format( "succeeded=%b\tallowed=%b\tugi=%s (AUTH=%s)\tip=%s\tcmd=%s\tsrc=%s\tdst=%s\t" + "perm=null", mSucceeded, mAllowed, mUgi, mAuthType, mIp, mCommand, mSrcPath, mDstPath); } } }
@Override public boolean checkPermission(String user, List<String> groups, Inode<?> inode, Mode.Bits permission) { short mode = inode.getMode(); if (user.equals(inode.getOwner())) { return Mode.extractOwnerBits(mode).imply(permission); } if (groups.contains(inode.getGroup())) { return Mode.extractGroupBits(mode).imply(permission); } return Mode.extractOtherBits(mode).imply(permission); }