Yii Framework Forum: [ask again] Rights extension.... - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[ask again] Rights extension.... bener2 butuh bantuan Rate Topic: -----

#1 User is offline   Mr D 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 217
  • Joined: 18-May 11

Posted 19 September 2011 - 05:10 AM

halo...
saya kan pake extension rights buat hak akses di web saya...
saya mau bikin 2 role SUPERADMIN sama ADMIN

SuperAdmin :: bisa akses semua modules rights
Admin :: hanya bisa akses Roles, Assignments, Permissions

bagaimana cara bikin role yang bisa akses Rights..


mohon bantuanya agan2 sekalian..
Boss: "We found a bug in your code!"
Programmer: "That's no bug, that's just an undocumented feature!"
0

#2 User is offline   junxiong 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 541
  • Joined: 21-June 10

Posted 19 September 2011 - 07:47 PM

Secara default "Admin" merupakan user yang bisa akses semuanya. Tetapi kalau agan mau menggunakan nama role "SuperAdmin" maka di config harus diganti dulu menjadi

'modules'=>array(
    'rights'=>array(
        'superuserName'=>'SuperAdmin',
    )
),


By default, hanya super user (dalam kasus ini "SuperAdmin) yang bisa akses semua module rights. Dan tidak ada role user lain yang bisa akses (termasuk hanya akses sebagian)

Biar ada role lain (dalam kasus ini "Admin") yang hanya bisa akses Roles, Assignment dan Permissions, maka harus ganti file-file controller di dalam folder /rights/controllers nya sih. Di situ akan terlihat Rights menggunakan access control list dengan setting hanya superuser yang boleh akses, saja. Agan harus ubah code disitu biar dia bisa terima user tipe lain.
“The most likely way for the world to be destroyed, most experts argue, is by accident. That’s where we come in; we’re computer professionals. We cause accidents.” - Nathaniel Borenstein

Yii Playground : Collaborative demo apps. You can join to improve it too!
My Team's Blog: In Indonesian.
0

#3 User is offline   Mr D 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 217
  • Joined: 18-May 11

Posted 19 September 2011 - 10:46 PM

View Postjunxiong, on 19 September 2011 - 07:47 PM, said:

Secara default "Admin" merupakan user yang bisa akses semuanya. Tetapi kalau agan mau menggunakan nama role "SuperAdmin" maka di config harus diganti dulu menjadi

'modules'=>array(
    'rights'=>array(
        'superuserName'=>'SuperAdmin',
    )
),


By default, hanya super user (dalam kasus ini "SuperAdmin) yang bisa akses semua module rights. Dan tidak ada role user lain yang bisa akses (termasuk hanya akses sebagian)

Biar ada role lain (dalam kasus ini "Admin") yang hanya bisa akses Roles, Assignment dan Permissions, maka harus ganti file-file controller di dalam folder /rights/controllers nya sih. Di situ akan terlihat Rights menggunakan access control list dengan setting hanya superuser yang boleh akses, saja. Agan harus ubah code disitu biar dia bisa terima user tipe lain.


makasi idenya...saya coba kutak katik dl kl gt...hehehe
Boss: "We found a bug in your code!"
Programmer: "That's no bug, that's just an undocumented feature!"
0

#4 User is offline   Mr D 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 217
  • Joined: 18-May 11

Posted 20 September 2011 - 02:40 AM

nanya lg dunk...kl menu yang dari rights saya ilangin kenapa linkny ada yg ga bisa di klik y??

Attached File  untitled.JPG (14.12K)
Number of downloads: 17

di gambar REVOKE nya ga bisa di klik..tp kalau 1 menu aja di tampilin jadi bisa..kalau semua nya di visible=>false jadi ga bisa di revoke..
Boss: "We found a bug in your code!"
Programmer: "That's no bug, that's just an undocumented feature!"
0

#5 User is offline   junxiong 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 541
  • Joined: 21-June 10

Posted 20 September 2011 - 07:30 AM

Ane gak pernah test sih... tapi mungkin saja pas ngilangin menu ada javascript yang gak berjalan atau ajax nya ada yang gak berfungsi?
“The most likely way for the world to be destroyed, most experts argue, is by accident. That’s where we come in; we’re computer professionals. We cause accidents.” - Nathaniel Borenstein

Yii Playground : Collaborative demo apps. You can join to improve it too!
My Team's Blog: In Indonesian.
0

#6 User is offline   ressaince 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 163
  • Joined: 10-January 11
  • Location:Jakarta

Posted 20 September 2011 - 11:48 AM

bikin aja lagi menunya... kan intinya cuma insert2 ke db aja..
saya juga bikin lagi menu buat permissionnya,abisnya berantakan sih kalo actionnya banyak
take it or leave it
0

#7 User is offline   Mr D 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 217
  • Joined: 18-May 11

Posted 20 September 2011 - 09:17 PM

View Postressaince, on 20 September 2011 - 11:48 AM, said:

bikin aja lagi menunya... kan intinya cuma insert2 ke db aja..
saya juga bikin lagi menu buat permissionnya,abisnya berantakan sih kalo actionnya banyak


maksudnya menu ny bikin lg itu yg di atas apa si REVOKE??

saya butuh kl dy admin menu rights ga keluar..tp mala link2nya jadi aneh...>.<
Boss: "We found a bug in your code!"
Programmer: "That's no bug, that's just an undocumented feature!"
0

#8 User is offline   Mr D 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 217
  • Joined: 18-May 11

Posted 20 September 2011 - 09:31 PM

mau nanya lagi ne...kan di rights saya ksh dy bisa ke index...pas index ada button Delete nya si CButtonColumn
nah pas klik delete kan harusnya msk ke halaman yang bilang kl ga ada hak buat delete tp mala keluar pop up massage error

Attached File  error.JPG (84.11K)
Number of downloads: 8

kenapa bisa keluar error seperti ini y??[403 forbiden ]

kadang2 ga keluar error ny tp juga ga ke redirect,jadi di halam index aja diem..knp dengan ajax ny y??
Boss: "We found a bug in your code!"
Programmer: "That's no bug, that's just an undocumented feature!"
0

#9 User is offline   Mr D 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 217
  • Joined: 18-May 11

Posted 21 September 2011 - 02:12 AM

View PostMr D, on 20 September 2011 - 09:31 PM, said:

mau nanya lagi ne...kan di rights saya ksh dy bisa ke index...pas index ada button Delete nya si CButtonColumn
nah pas klik delete kan harusnya msk ke halaman yang bilang kl ga ada hak buat delete tp mala keluar pop up massage error

Attachment error.JPG

kenapa bisa keluar error seperti ini y??[403 forbiden ]

kadang2 ga keluar error ny tp juga ga ke redirect,jadi di halam index aja diem..knp dengan ajax ny y??


sukses juga dengan matiin ajaxnya.... <_<
Boss: "We found a bug in your code!"
Programmer: "That's no bug, that's just an undocumented feature!"
0

#10 User is offline   ressaince 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 163
  • Joined: 10-January 11
  • Location:Jakarta

Posted 21 September 2011 - 07:42 PM

saya bikin lagi form baru yang lebih rapih untuk centang2in permissionnya hahhahahaha
cara bodoh tapi efektif
take it or leave it
0

#11 User is offline   Mr D 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 217
  • Joined: 18-May 11

Posted 26 September 2011 - 04:23 AM

nanya lg dunk..kalau pas
Assignments
dan kita klik user kita bisa pasang rolenya dengan pilihan yang ada di dropdownya..
saya mau filter pilihan di dropdownya itu gimana y??

mohon pencerahanya....
Boss: "We found a bug in your code!"
Programmer: "That's no bug, that's just an undocumented feature!"
0

#12 User is offline   junxiong 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 541
  • Joined: 21-June 10

Posted 26 September 2011 - 09:13 AM

Kalau ane telusuri code Rights, dia ambil data di file rights/controllers/AssignmentController.php di baris ke 91 dengan code seperti ini:
$assignSelectOptions = Rights::getAuthItemSelectOptions(null, $assignments);


yang dilempar ke views/assignment/user.php, dan dilanjutkan ke views/assignment/_form.php

Jadi kalau mau ganti filter, bisa ganti baris yang ane tunjukkin itu atau kalau nggak mungkin modif Rights::getAuthItemSelectOptions().
“The most likely way for the world to be destroyed, most experts argue, is by accident. That’s where we come in; we’re computer professionals. We cause accidents.” - Nathaniel Borenstein

Yii Playground : Collaborative demo apps. You can join to improve it too!
My Team's Blog: In Indonesian.
0

#13 User is offline   Mr D 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 217
  • Joined: 18-May 11

Posted 26 September 2011 - 09:04 PM

View Postjunxiong, on 26 September 2011 - 09:13 AM, said:

Kalau ane telusuri code Rights, dia ambil data di file rights/controllers/AssignmentController.php di baris ke 91 dengan code seperti ini:
$assignSelectOptions = Rights::getAuthItemSelectOptions(null, $assignments);


yang dilempar ke views/assignment/user.php, dan dilanjutkan ke views/assignment/_form.php

Jadi kalau mau ganti filter, bisa ganti baris yang ane tunjukkin itu atau kalau nggak mungkin modif Rights::getAuthItemSelectOptions().


y itu baru aja ktm saya...saya unset si admin...
kalau mau filter yang di tampilin pass assignment gmn yy..jadi user yang statusnya Admin ga keliatan sama si SuperUser.

\rights\controllers\AssignmentController.php
public function actionView()
	{
		// Create a data provider for listing the users
		$dataProvider = new RAssignmentDataProvider(array(
			'pagination'=>array(
				'pageSize'=>50,
			),
		));

		// Render the view
		$this->render('view', array(
			'dataProvider'=>$dataProvider,
		));
	}



rights/component/behavior/RUserBehacior.php
	public function getAssignments()
	{
----
----
    	unset($assignments[2]['Admin']);
		return $this->_assignments = $assignments;
		}


kalau saya unset seperti di atas role admin ga keluar..tp usernya msh ada aja..ga ikutan ilang..
codenya dimn si ketemu...tapi ga gerti baca modelnya gmn caranya dy bisa dptin user.. <_<
mohon sangat bantuanya
::)
Boss: "We found a bug in your code!"
Programmer: "That's no bug, that's just an undocumented feature!"
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users