Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add File Permissions to generated documents #567

Merged
merged 2 commits into from
Jul 26, 2018

Conversation

dadoonet
Copy link
Owner

@dadoonet dadoonet commented Jul 25, 2018

Add File Permissions to generated documents

Note: this does not work on Windows.

This is adding File Permissions as their octal representation (740 for example) when attributes_support is set to true.

Example of a generated document:

{
  "file":{
     "filename":"test.odt",
     "extension":"odt",
     "last_modified":1386855978000,
     "indexing_date":"2013-12-12T13:50:58.758Z",
     "content_type":"application/vnd.oasis.opendocument.text",
     "url":"file:///tmp/testfs_metadata/test.odt",
     "indexed_chars":100000,
     "filesize":8355,
     "checksum":"c32eafae2587bef4b3b32f73743c3c61"
  },
  "path":{
     "root":"bceb3913f6d793e915beb70a4735592",
     "virtual":"/test.odt",
     "real":"/tmp/testfs_metadata/test.odt"
  },
  "attributes": {
     "owner": "david",
     "group": "staff",
     "permissions": 764
  },
  "meta":{
     "author":"David Pilato",
     "title":"Mon titre",
     "date":"2013-04-04T15:21:35",
     "keywords":[
        "fs",
        "elasticsearch",
        "crawler"
     ],
     "language":"fr"
  },
  "content":"Bonjour David\n\n\n"
}

Closes #559.

@dadoonet dadoonet added the new For new features or options label Jul 25, 2018
@dadoonet dadoonet added this to the 2.5 milestone Jul 25, 2018
@dadoonet dadoonet self-assigned this Jul 25, 2018
@dadoonet dadoonet changed the title WIP: Add File Permissions to generated documents Add File Permissions to generated documents Jul 26, 2018
dadoonet added 2 commits July 26, 2018 11:27
Note: this does not work on Windows.

This is adding File Permissions as their octal representation (`740` for example) when `attributes_support` is set to `true`.

Example of a generated document:

```json
{
  "file":{
     "filename":"test.odt",
     "extension":"odt",
     "last_modified":1386855978000,
     "indexing_date":"2013-12-12T13:50:58.758Z",
     "content_type":"application/vnd.oasis.opendocument.text",
     "url":"file:///tmp/testfs_metadata/test.odt",
     "indexed_chars":100000,
     "filesize":8355,
     "checksum":"c32eafae2587bef4b3b32f73743c3c61"
  },
  "path":{
     "root":"bceb3913f6d793e915beb70a4735592",
     "virtual":"/test.odt",
     "real":"/tmp/testfs_metadata/test.odt"
  },
  "attributes": {
     "owner": "david",
     "group": "staff",
     "permissions": 764
  },
  "meta":{
     "author":"David Pilato",
     "title":"Mon titre",
     "date":"2013-04-04T15:21:35",
     "keywords":[
        "fs",
        "elasticsearch",
        "crawler"
     ],
     "language":"fr"
  },
  "content":"Bonjour David\n\n\n"
}
```

Closes #559.
So we have a better code and SonarCloud is happy :)
@dadoonet dadoonet force-pushed the pr/add-posix-permissions branch from 9e91a19 to 988d929 Compare July 26, 2018 09:28
@dadoonet dadoonet merged commit 622a2b7 into master Jul 26, 2018
@dadoonet dadoonet deleted the pr/add-posix-permissions branch July 26, 2018 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new For new features or options
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant