Permalink
Browse files

Checkpoint. Role create working.

  • Loading branch information...
1 parent 5c93f7e commit cb2c840da218032e13500b599af97dcfeace1659 @jhannah committed Mar 29, 2011
Showing with 27 additions and 0 deletions.
  1. +9 −0 lib/KiokuX/Model/UserAccounts.pm
  2. +18 −0 lib/KiokuX/Model/UserAccounts/Role.pm
@@ -28,6 +28,15 @@ sub get_identity {
return $self->lookup("identity:$id");
}
+=head2 get_role
+
+=cut
+
+sub get_role {
+ my ($self, $id) = @_;
+ return $self->lookup("role:$id");
+}
+
=head1 VERSION CONTROL
L<http://github.com/jhannah/kiokux-model-useraccounts/>
@@ -1,6 +1,24 @@
package KiokuX::Model::UserAccounts::Role;
use Moose::Role;
+with qw(KiokuDB::Role::ID);
+
+sub id_for_role {
+ my ( $self, $id ) = @_;
+ return "role:$id"
+}
+
+sub kiokudb_object_id {
+ my $self = shift;
+ $self->id_for_role($self->id);
+}
+
+has id => (
+ isa => "Str",
+ is => "ro",
+ required => 1,
+);
+
no Moose::Role;

0 comments on commit cb2c840

Please sign in to comment.