Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Checkpoint. Role create working.

  • Loading branch information...
commit cb2c840da218032e13500b599af97dcfeace1659 1 parent 5c93f7e
Jay Hannah authored March 28, 2011
9  lib/KiokuX/Model/UserAccounts.pm
@@ -28,6 +28,15 @@ sub get_identity {
28 28
     return $self->lookup("identity:$id");
29 29
 }
30 30
 
  31
+=head2 get_role
  32
+
  33
+=cut
  34
+
  35
+sub get_role {
  36
+    my ($self, $id) = @_;
  37
+    return $self->lookup("role:$id");
  38
+}
  39
+
31 40
 =head1 VERSION CONTROL
32 41
 
33 42
 L<http://github.com/jhannah/kiokux-model-useraccounts/>
18  lib/KiokuX/Model/UserAccounts/Role.pm
... ...
@@ -1,6 +1,24 @@
1 1
 package KiokuX::Model::UserAccounts::Role;
2 2
 use Moose::Role;
3 3
 
  4
+with qw(KiokuDB::Role::ID);
  5
+
  6
+sub id_for_role {
  7
+    my ( $self, $id ) = @_;
  8
+    return "role:$id"
  9
+}
  10
+
  11
+sub kiokudb_object_id {
  12
+    my $self = shift;
  13
+    $self->id_for_role($self->id);
  14
+}
  15
+
  16
+has id => (
  17
+    isa => "Str",
  18
+    is  => "ro",
  19
+    required => 1,
  20
+);
  21
+
4 22
 
5 23
 no Moose::Role;
6 24
 

0 notes on commit cb2c840

Please sign in to comment.
Something went wrong with that request. Please try again.