volumeAccessPolicyWithDefault :: Permission -> Maybe Bool -> VolumeRolePolicy
volumeAccessPolicyWithDefault perm1 mShareFull =
  case perm1 of
    PermissionNONE ->
      RoleNone
    PermissionPUBLIC ->
      RolePublicViewer (toPolicyDefaulting mShareFull PublicNoPolicy PublicRestrictedPolicy)
    PermissionSHARED ->
      RoleSharedViewer (toPolicyDefaulting mShareFull SharedNoPolicy SharedRestrictedPolicy)
    PermissionREAD ->
      RoleReader
    PermissionEDIT ->
      RoleEditor
    PermissionADMIN ->
      RoleAdmin
volumeAccessPolicyWithDefault :: Permission -> Maybe Bool -> VolumeRolePolicy
volumeAccessPolicyWithDefault perm1 mShareFull =
  case perm1 of
    PermissionNONE ->
      RoleNone
    PermissionPUBLIC ->
      RolePublicViewer (toPolicyDefaulting mShareFull PublicNoPolicy PublicRestrictedPolicy)
    PermissionSHARED ->
      RoleSharedViewer (toPolicyDefaulting mShareFull SharedNoPolicy SharedRestrictedPolicy)
    PermissionREAD ->
      RoleReader
    PermissionEDIT ->
      RoleEditor
    PermissionADMIN ->
      RoleAdmin
volumeAccessPolicyWithDefault perm1 mShareFull =
  case perm1 of
    PermissionNONE ->
      RoleNone
    PermissionPUBLIC ->
      RolePublicViewer (toPolicyDefaulting mShareFull PublicNoPolicy PublicRestrictedPolicy)
    PermissionSHARED ->
      RoleSharedViewer (toPolicyDefaulting mShareFull SharedNoPolicy SharedRestrictedPolicy)
    PermissionREAD ->
      RoleReader
    PermissionEDIT ->
      RoleEditor
    PermissionADMIN ->
      RoleAdmin