import 'package:equatable/equatable.dart';

class Capabilities extends Equatable {
  final bool canRead;
  final bool canWrite;
  final bool canShare;
  final bool canAdmin;
  final bool canAnnotate;
  final bool canEdit;

  const Capabilities({
    required this.canRead,
    required this.canWrite,
    required this.canShare,
    required this.canAdmin,
    required this.canAnnotate,
    required this.canEdit,
  });

  @override
  List<Object> get props => [
    canRead,
    canWrite,
    canShare,
    canAdmin,
    canAnnotate,
    canEdit,
  ];
}

abstract class PermissionState extends Equatable {
  const PermissionState();

  @override
  List<Object> get props => [];
}

class PermissionInitial extends PermissionState {}

class PermissionLoading extends PermissionState {}

class PermissionLoaded extends PermissionState {
  final Capabilities capabilities;

  const PermissionLoaded(this.capabilities);

  @override
  List<Object> get props => [capabilities];
}

class PermissionDenied extends PermissionState {
  final String error;

  const PermissionDenied(this.error);

  @override
  List<Object> get props => [error];
}
