Permalink
Browse files

Checkpoint

  • Loading branch information...
1 parent 818fa75 commit 2e376c5ca76edf1c79dfcf4b9e6f4f4afaece67f @jhannah committed Mar 27, 2011
@@ -17,6 +17,18 @@ KiokuX::Model::UserAccounts - Decoupled security roles for L<KiokuDB>
L<http://blog.woobling.org/2009/06/users-accounts-identities-and-roles.html>
+=head1 METHODS
+
+=head2 get_identity
+
+=cut
+
+sub get_identity {
+ my $self = shift;
+ my ($user_id) = @_;
+ return $self->lookup("identity:$user_id");
+}
+
=head1 VERSION CONTROL
L<http://github.com/jhannah/kiokux-model-useraccounts/>
@@ -1,8 +1,6 @@
package KiokuX::Model::UserAccounts::Account;
use Moose::Role;
-__PACKAGE__->meta->make_immutable;
-no Moose;
1;
@@ -1,8 +1,20 @@
package KiokuX::Model::UserAccounts::Identity;
use Moose::Role;
-__PACKAGE__->meta->make_immutable;
-no Moose;
+with qw(
+ KiokuX::User
+ KiokuDB::Role::ID
+);
+
+has user => (
+ is => 'rw',
+ isa => 'Narwhal::User',
+);
+
+has name => (
+ is => 'rw',
+ isa => 'Str',
+);
1;
@@ -1,8 +1,6 @@
package KiokuX::Model::UserAccounts::Role;
use Moose::Role;
-__PACKAGE__->meta->make_immutable;
-no Moose;
1;
@@ -1,9 +1,17 @@
package KiokuX::Model::UserAccounts::User;
use Moose::Role;
-__PACKAGE__->meta->make_immutable;
-no Moose;
+with qw(
+ KiokuX::User
+ KiokuDB::Role::ID
+);
-1;
+
+has jay => (
+ is => 'rw',
+ isa => 'Str',
+ default => 'FOOBITY!'
+);
+1;

0 comments on commit 2e376c5

Please sign in to comment.