1 package DBIx::Class::Schema::RestrictByUser::RestrictComp::Source;
8 For general usage please see L<DBIx::Class::Schema::RestrictByUser>, the information
9 provided here is not meant for general use and is subject to change. In the interest
10 of transparency the functionality presented is documented, but all methods should be
11 considered private and, as such, subject to incompatible changes and removal.
13 =head1 PRIVATE METHODS
17 Intercept call to C<resultset> and return restricted resultset
23 my $rs = $self->next::method(@_);
24 if (my $user = $self->schema->user) {
25 my $s = $self->source_name;
27 my $pre = $self->schema->restricted_prefix;
28 my $meth = "restrict_${s}_resultset";
31 my $meth_pre = "restrict_${pre}_${s}_resultset";
32 return $user->$meth_pre($rs) if $user->can($meth_pre);
34 $rs = $user->$meth($rs) if $user->can($meth);
43 L<DBIx::Class::Schema::RestrictByUser>,