# Namespace KFileShare

Module | kio
Namespace | KFileShare

Common functionality for the file sharing (communication with the backend)

### enums

- Authorization { NotInitialized, ErrorNotFound, Authorized, UserNotAllowed }
- ShareMode { Simple, Advanced }

enum details

### methods

- authorization ( )

  returns KFileShare.Authorization

  Call this to know if the current user is authorized to share directories

- fileShareGroup ( )

  returns QString

  Returns the group that is used for file sharing. That is, all users in that group are allowed to share files if file sharing is restricted.

- isDirectoryShared (path)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  path | QString |

  Call this to know if a directory is currently shared

- isRestricted ( )

  returns bool

  Returns whether file sharing is restricted. If it is not restricted every user can shar files. If it is restricted only users in the configured file share group can share files.

- nfsEnabled ( )

  returns bool

  Returns whether NFS is enabled

- readConfig ( )

  returns Nothing

  Reads the file share configuration file

- readShareList ( )

  returns Nothing

  Reads the list of shared folders

- sambaEnabled ( )

  returns bool

  Returns whether Samba is enabled

- setShared (path, shared)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  path | QString |
  shared | bool |

  Uses a suid perl script to share the given path with NFS and Samba

  path - the path to share

  shared - whether the path should be shared or not Returns whether the perl script was successful

- shareMode ( )

  returns KFileShare.ShareMode

  Returns the configured share mode

- sharingEnabled ( )

  returns bool

  Returns whether sharing is enabled If this is false, file sharing is disabled and nobody can share files.

### enums - detail

- Authorization { NotInitialized, ErrorNotFound, Authorized, UserNotAllowed }

  | NotInitialized | - | - |
  | ErrorNotFound | - | - |
  | Authorized | - | - |
  | UserNotAllowed | - | - |

- ShareMode { Simple, Advanced }

  The used share mode. Simple means that the simple sharing dialog is used and users can share only folders from there HOME folder. Advanced means that the advanced sharing dialog is used and users can share any folder.

  | Simple | - | - |
  | Advanced | - | - |